mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Bug 1724234 - Remove unused shell 'intern' function r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D121885
This commit is contained in:
parent
c5375c273c
commit
b1a5cce7f2
@ -4061,29 +4061,6 @@ static bool DummyPreserveWrapperCallback(JSContext* cx, HandleObject obj) {
|
||||
|
||||
static bool DummyHasReleasedWrapperCallback(HandleObject obj) { return true; }
|
||||
|
||||
static bool Intern(JSContext* cx, unsigned argc, Value* vp) {
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
JSString* str = JS::ToString(cx, args.get(0));
|
||||
if (!str) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AutoStableStringChars strChars(cx);
|
||||
if (!strChars.initTwoByte(cx, str)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mozilla::Range<const char16_t> chars = strChars.twoByteRange();
|
||||
|
||||
if (!JS_AtomizeAndPinUCStringN(cx, chars.begin().get(), chars.length())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
args.rval().setUndefined();
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef FUZZING_JS_FUZZILLI
|
||||
// We have to assume that the fuzzer will be able to call this function e.g. by
|
||||
// enumerating the properties of the global object and eval'ing them. As such
|
||||
@ -9524,10 +9501,6 @@ static const JSFunctionSpecWithHelp shell_functions[] = {
|
||||
|
||||
#endif
|
||||
|
||||
JS_FN_HELP("intern", Intern, 1, 0,
|
||||
"intern(str)",
|
||||
" Internalize str in the atom table."),
|
||||
|
||||
JS_FN_HELP("getslx", GetSLX, 1, 0,
|
||||
"getslx(obj)",
|
||||
" Get script line extent."),
|
||||
|
Loading…
Reference in New Issue
Block a user