Issue #1691 - Part 12: Fix return value in ExecScript() and debug assert in ParseTask. https://bugzilla.mozilla.org/show_bug.cgi?id=1331662 Replace nsJSUtils::EvaluateString calls by ExecutionContext scopes. ExecutionContext: The mRetValue is not used even though it is checked in various asserts. This is how it is in the Mozilla code even years later, only the passed in value is used. ParseTask: JoinDecode() and JoinCompile() run the same code but the type is different causing a debug assert when it checks the type Script vs ScriptDecode.

(cherry picked from commit 8f577428b7834b7d0f0d5afacbe060fbb1ff2136)
This commit is contained in:
Brian Smith 2023-04-23 17:53:38 -05:00 committed by roytam1
commit a892a75903
4 changed files with 11 additions and 224 deletions

View file

@ -2350,7 +2350,7 @@ ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest)
{
nsJSUtils::ExecutionContext exec(cx, global);
if (aRequest->mOffThreadToken) {
rv = exec.JoinDecode(&aRequest->mOffThreadToken);
rv = exec.JoinCompile(&aRequest->mOffThreadToken);
} else {
nsAutoString inlineData;
SourceBufferHolder srcBuf = GetScriptSource(aRequest, inlineData);