Bug 1042798 - Use an AutoEntryScript in nsNPAPIPlugin _evaluate as we are about to run script and need to ensure the correct JSContext* gets pushed. r=bholley

This commit is contained in:
Bob Owen
2014-07-28 09:27:23 +01:00
parent 9d55bef853
commit 1a1e82cbff

View File

@@ -1483,8 +1483,8 @@ _evaluate(NPP npp, NPObject* npobj, NPString *script, NPVariant *result)
return false;
}
AutoSafeJSContext cx;
JSAutoCompartment ac(cx, win->FastGetGlobalJSObject());
dom::AutoEntryScript aes(win);
JSContext* cx = aes.cx();
JS::Rooted<JSObject*> obj(cx, nsNPObjWrapper::GetNewOrUsed(npp, cx, npobj));