mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-01 05:43:46 +00:00
Bug 949108 - Rooting hazards in nsScriptLoader.cpp due to AutoPushJSContext, r=bz
--HG-- extra : rebase_source : 02c19e3831118d3d4703c7904ea0b7228c06261f
This commit is contained in:
parent
b31e1049fa
commit
ab8787514a
@ -789,8 +789,11 @@ nsScriptLoader::AttemptAsyncScriptParse(nsScriptLoadRequest* aRequest)
|
||||
if (!context) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
AutoPushJSContext cx(context->GetNativeContext());
|
||||
JS::Rooted<JSObject*> global(cx, unrootedGlobal);
|
||||
|
||||
JSContext* unpushedCx = context->GetNativeContext();
|
||||
JSAutoRequest ar(unpushedCx);
|
||||
JS::Rooted<JSObject*> global(unpushedCx, unrootedGlobal);
|
||||
AutoPushJSContext cx(unpushedCx);
|
||||
|
||||
JS::CompileOptions options(cx);
|
||||
FillCompileOptionsForRequest(aRequest, global, &options);
|
||||
@ -1002,8 +1005,11 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest,
|
||||
if (!context) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
AutoPushJSContext cx(context->GetNativeContext());
|
||||
JS::Rooted<JSObject*> global(cx, unrootedGlobal);
|
||||
|
||||
JSContext* unpushedCx = context->GetNativeContext();
|
||||
JSAutoRequest ar(unpushedCx);
|
||||
JS::Rooted<JSObject*> global(unpushedCx, unrootedGlobal);
|
||||
AutoPushJSContext cx(unpushedCx);
|
||||
|
||||
bool oldProcessingScriptTag = context->GetProcessingScriptTag();
|
||||
context->SetProcessingScriptTag(true);
|
||||
|
Loading…
Reference in New Issue
Block a user