mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Issue #2686 - Don't rely on return value of ExecutionContext::Compile when the context may forbid running scripts
This is relevant if scripting is terminated due to execution timeout but there are setTimeout/Interval callbacks pending or if scripting is disabled altogether.
This commit is contained in:
parent
77728935ef
commit
0590764f1f
4 changed files with 12 additions and 8 deletions
|
|
@ -2377,10 +2377,7 @@ ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest)
|
|||
rv = exec.Compile(options, srcBuf);
|
||||
}
|
||||
if (rv == NS_OK) {
|
||||
JS::Rooted<JSScript*> script(cx);
|
||||
script = exec.GetScript();
|
||||
|
||||
// With scripts disabled GetScript() will return nullptr
|
||||
JS::Rooted<JSScript*> script(cx, exec.GetScript());
|
||||
if (script) {
|
||||
// Create a ClassicScript object and associate it with the
|
||||
// JSScript.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue