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:
Martok 2025-01-26 21:46:31 +01:00 • committed by roytam1
commit 0590764f1f
4 changed files with 12 additions and 8 deletions

View file

@ -163,7 +163,10 @@ public:
// thread.
nsresult JoinDecode(void** aOffThreadToken);
// Get a successfully compiled script.
// Get the compiled script if present, or nullptr.
//
// Compilation may succeed without producing a script when scripting is disabled for the global. Causes for this can
// be the global pref or dynamic change when script execution in a global is terminated due to max_script_run_time.
JSScript* GetScript();
// Execute the compiled script and ignore the return value.