mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 978042 - Part 2: AutoPushJSContext in nsGlobalWindow::RunTimeoutHandler. r=bholley
This commit is contained in:
parent
3fbc188f5e
commit
db45c8c58e
@ -11853,13 +11853,16 @@ nsGlobalWindow::RunTimeoutHandler(nsTimeout* aTimeout,
|
||||
uint32_t lineNo = 0;
|
||||
handler->GetLocation(&filename, &lineNo);
|
||||
|
||||
AutoPushJSContext cx(aScx->GetNativeContext());
|
||||
JS::CompileOptions options(cx);
|
||||
// New script entry point required, due to the "Create a script" sub-step of
|
||||
// http://www.whatwg.org/specs/web-apps/current-work/#timer-initialization-steps
|
||||
AutoEntryScript entryScript(this, true, aScx->GetNativeContext());
|
||||
JS::CompileOptions options(entryScript.cx());
|
||||
options.setFileAndLine(filename, lineNo)
|
||||
.setVersion(JSVERSION_DEFAULT);
|
||||
JS::Rooted<JSObject*> global(cx, FastGetGlobalJSObject());
|
||||
aScx->EvaluateString(nsDependentString(script), global,
|
||||
options, /*aCoerceToString = */ false, nullptr);
|
||||
JS::Rooted<JSObject*> global(entryScript.cx(), FastGetGlobalJSObject());
|
||||
nsJSUtils::EvaluateOptions evalOptions;
|
||||
nsJSUtils::EvaluateString(entryScript.cx(), nsDependentString(script),
|
||||
global, options, evalOptions, nullptr);
|
||||
} else {
|
||||
// Hold strong ref to ourselves while we call the callback.
|
||||
nsCOMPtr<nsISupports> me(static_cast<nsIDOMWindow *>(this));
|
||||
|
Loading…
Reference in New Issue
Block a user