Issue #1952 - m-c 1383775: Clean up function toString/toSource code, remove remnants of source decompiler

This commit is contained in:
Martok 2022-07-01 12:53:23 +02:00 • committed by roytam1
commit 85af7f6e80
24 changed files with 55 additions and 64 deletions

View file

@ -8849,7 +8849,7 @@ js::IsAsmJSModuleLoadedFromCache(JSContext* cx, unsigned argc, Value* vp)
// asm.js toString/toSource support
JSString*
js::AsmJSModuleToString(JSContext* cx, HandleFunction fun, bool addParenToLambda)
js::AsmJSModuleToString(JSContext* cx, HandleFunction fun, bool isToSource)
{
MOZ_ASSERT(IsAsmJSModule(fun));
@ -8860,7 +8860,7 @@ js::AsmJSModuleToString(JSContext* cx, HandleFunction fun, bool addParenToLambda
StringBuffer out(cx);
if (addParenToLambda && fun->isLambda() && !out.append("("))
if (isToSource && fun->isLambda() && !out.append("("))
return nullptr;
bool haveSource = source->hasSourceData();
@ -8883,7 +8883,7 @@ js::AsmJSModuleToString(JSContext* cx, HandleFunction fun, bool addParenToLambda
return nullptr;
}
if (addParenToLambda && fun->isLambda() && !out.append(")"))
if (isToSource && fun->isLambda() && !out.append(")"))
return nullptr;
return out.finishString();