1320408 - Part 12: Change JSScript::sourceData to static method.

This commit is contained in:
Gaming4JC 2019-06-08 21:10:15 -04:00 committed by Roy Tam
commit d208cccd10
9 changed files with 16 additions and 15 deletions

View file

@ -4405,14 +4405,15 @@ JS_DecompileScript(JSContext* cx, HandleScript script, const char* name, unsigne
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
script->ensureNonLazyCanonicalFunction(cx);
script->ensureNonLazyCanonicalFunction();
RootedFunction fun(cx, script->functionNonDelazifying());
if (fun)
return JS_DecompileFunction(cx, fun, indent);
bool haveSource = script->scriptSource()->hasSourceData();
if (!haveSource && !JSScript::loadSource(cx, script->scriptSource(), &haveSource))
return nullptr;
return haveSource ? script->sourceData(cx) : NewStringCopyZ<CanGC>(cx, "[no source]");
return haveSource ? JSScript::sourceData(cx, script)
: NewStringCopyZ<CanGC>(cx, "[no source]");
}
JS_PUBLIC_API(JSString*)