mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +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
|
|
@ -12941,10 +12941,11 @@ nsGlobalWindow::RunTimeoutHandler(Timeout* aTimeout,
|
|||
nsJSUtils::ExecutionContext exec(aes.cx(), global);
|
||||
rv = exec.Compile(options, handler->GetHandlerText());
|
||||
|
||||
if (rv == NS_OK) {
|
||||
JS::Rooted<JSScript*> script(aes.cx(), exec.GetScript());
|
||||
if (script) {
|
||||
LoadedScript* initiatingScript = handler->GetInitiatingScript();
|
||||
if (initiatingScript) {
|
||||
initiatingScript->AssociateWithScript(exec.GetScript());
|
||||
initiatingScript->AssociateWithScript(script);
|
||||
}
|
||||
|
||||
rv = exec.ExecScript();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue