mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Issue #1952 - m-c 1383775: Clean up function toString/toSource code, remove remnants of source decompiler
This commit is contained in:
parent
1e753237e5
commit
85af7f6e80
24 changed files with 55 additions and 64 deletions
|
|
@ -4438,7 +4438,7 @@ JS::CompileFunction(JSContext* cx, AutoObjectVector& envChain,
|
|||
}
|
||||
|
||||
JS_PUBLIC_API(JSString*)
|
||||
JS_DecompileScript(JSContext* cx, HandleScript script, const char* name, unsigned indent)
|
||||
JS_DecompileScript(JSContext* cx, HandleScript script)
|
||||
{
|
||||
MOZ_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
|
||||
|
||||
|
|
@ -4447,7 +4447,7 @@ JS_DecompileScript(JSContext* cx, HandleScript script, const char* name, unsigne
|
|||
script->ensureNonLazyCanonicalFunction();
|
||||
RootedFunction fun(cx, script->functionNonDelazifying());
|
||||
if (fun)
|
||||
return JS_DecompileFunction(cx, fun, indent);
|
||||
return JS_DecompileFunction(cx, fun);
|
||||
bool haveSource = script->scriptSource()->hasSourceData();
|
||||
if (!haveSource && !JSScript::loadSource(cx, script->scriptSource(), &haveSource))
|
||||
return nullptr;
|
||||
|
|
@ -4456,13 +4456,13 @@ JS_DecompileScript(JSContext* cx, HandleScript script, const char* name, unsigne
|
|||
}
|
||||
|
||||
JS_PUBLIC_API(JSString*)
|
||||
JS_DecompileFunction(JSContext* cx, HandleFunction fun, unsigned indent)
|
||||
JS_DecompileFunction(JSContext* cx, HandleFunction fun)
|
||||
{
|
||||
MOZ_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
|
||||
AssertHeapIsIdle(cx);
|
||||
CHECK_REQUEST(cx);
|
||||
assertSameCompartment(cx, fun);
|
||||
return FunctionToString(cx, fun, !(indent & JS_DONT_PRETTY_PRINT));
|
||||
return FunctionToString(cx, fun, /* isToSource = */ false);
|
||||
}
|
||||
|
||||
MOZ_NEVER_INLINE static bool
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue