From 81394883a8c7e18b894273b564a2b9412b9d4694 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Wed, 16 Jul 2014 12:24:36 +0100 Subject: [PATCH] Bug 1037904 Part 2: Replace nsCxPusher in nsJSObjWrapper::NP_HasProperties. r=bholley --- dom/plugins/base/nsJSNPRuntime.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 37f7693d79fd..c743f3484a6a 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -700,11 +700,11 @@ bool nsJSObjWrapper::NP_HasProperty(NPObject *npobj, NPIdentifier npid) { NPP npp = NPPStack::Peek(); - JSContext *cx = GetJSContext(npp); - - if (!cx) { + dom::AutoJSAPI jsapi; + if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(GetGlobalObject(npp)))) { return false; } + JSContext *cx = jsapi.cx(); if (!npobj) { ThrowJSException(cx, @@ -716,8 +716,6 @@ nsJSObjWrapper::NP_HasProperty(NPObject *npobj, NPIdentifier npid) nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj; bool found, ok = false; - nsCxPusher pusher; - pusher.Push(cx); AutoJSExceptionReporter reporter(cx); JS::Rooted jsobj(cx, npjsobj->mJSObj); JSAutoCompartment ac(cx, jsobj);