From e3b2de6aa90aebb73f5a221d00988ee34ae0af1b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 23 Mar 2016 11:44:54 -0400 Subject: [PATCH] Bug 1255817 part 2. Get rid of AutoJSAPI::OwnsErrorReporting and AutoJSAPI::TakeOwnershipOfErrorReporting. r=bholley --- dom/base/ScriptSettings.cpp | 7 ------- dom/base/ScriptSettings.h | 9 +-------- dom/base/WebSocket.cpp | 1 - dom/base/nsContentUtils.cpp | 4 ---- dom/base/nsJSEnvironment.cpp | 1 - dom/base/nsJSUtils.cpp | 1 - dom/base/nsScriptLoader.cpp | 1 - dom/bindings/CallbackObject.cpp | 1 - dom/bindings/Codegen.py | 1 - dom/bindings/Exceptions.cpp | 1 - dom/canvas/WebGLContextUtils.cpp | 2 -- dom/events/EventListenerManager.cpp | 1 - dom/indexedDB/IDBRequest.cpp | 1 - dom/mobilemessage/MobileMessageCallback.cpp | 1 - dom/plugins/base/nsJSNPRuntime.cpp | 1 - dom/promise/Promise.cpp | 2 -- dom/workers/ScriptLoader.cpp | 1 - dom/workers/ServiceWorkerEvents.cpp | 1 - dom/workers/WorkerPrivate.cpp | 1 - dom/workers/WorkerRunnable.cpp | 1 - dom/workers/XMLHttpRequest.cpp | 1 - dom/xbl/nsXBLProtoImpl.cpp | 1 - dom/xbl/nsXBLPrototypeHandler.cpp | 1 - js/ipc/WrapperAnswer.cpp | 17 ----------------- js/xpconnect/loader/mozJSComponentLoader.cpp | 4 ---- 25 files changed, 1 insertion(+), 62 deletions(-) diff --git a/dom/base/ScriptSettings.cpp b/dom/base/ScriptSettings.cpp index 1b9c9ae938c8..56bae426b218 100644 --- a/dom/base/ScriptSettings.cpp +++ b/dom/base/ScriptSettings.cpp @@ -551,11 +551,6 @@ WarningOnlyErrorReporter(JSContext* aCx, const char* aMessage, JSErrorReport* aR xpcReport->LogToConsole(); } -void -AutoJSAPI::TakeOwnershipOfErrorReporting() -{ -} - void AutoJSAPI::ReportException() { @@ -660,8 +655,6 @@ AutoEntryScript::AutoEntryScript(nsIGlobalObject* aGlobalObject, if (aIsMainThread && gRunToCompletionListeners > 0) { mDocShellEntryMonitor.emplace(cx(), aReason); } - - TakeOwnershipOfErrorReporting(); } AutoEntryScript::AutoEntryScript(JSObject* aObject, diff --git a/dom/base/ScriptSettings.h b/dom/base/ScriptSettings.h index 654a42778a1c..95fddc31957c 100644 --- a/dom/base/ScriptSettings.h +++ b/dom/base/ScriptSettings.h @@ -267,14 +267,7 @@ public: bool CxPusherIsStackTop() const { return mCxPusher->IsStackTop(); } - // We're moving towards a world where the AutoJSAPI always handles - // exceptions that bubble up from the JS engine. In order to make this - // process incremental, we allow consumers to opt-in to the new behavior - // while keeping the old behavior as the default. - void TakeOwnershipOfErrorReporting(); - bool OwnsErrorReporting() { return true; } - // If HasException, report it. Otherwise, a no-op. This must be - // called only if OwnsErrorReporting(). + // If HasException, report it. Otherwise, a no-op. void ReportException(); bool HasException() const { diff --git a/dom/base/WebSocket.cpp b/dom/base/WebSocket.cpp index 3da1fb275ab9..076c05268dee 100644 --- a/dom/base/WebSocket.cpp +++ b/dom/base/WebSocket.cpp @@ -1886,7 +1886,6 @@ WebSocket::CreateAndDispatchMessageEvent(const nsACString& aData, } } - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); nsresult rv = CheckInnerWindowCorrectness(); diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index b07dad37dc53..5c00cae82996 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -6490,10 +6490,6 @@ nsContentUtils::IsPatternMatching(nsAString& aValue, nsAString& aPattern, jsapi.Init(); JSContext* cx = jsapi.cx(); - // Failure to create or run the regexp results in the invalid pattern - // matching, but we can still report the error to the console. - jsapi.TakeOwnershipOfErrorReporting(); - // We can use the junk scope here, because we're just using it for // regexp evaluation, not actual script execution. JSAutoCompartment ac(cx, xpc::UnprivilegedJunkScope()); diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index d367a6ff72ea..2ddeb61390b0 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -842,7 +842,6 @@ nsJSContext::SetProperty(JS::Handle aTarget, const char* aPropName, n if (NS_WARN_IF(!jsapi.Init(GetGlobalObject()))) { return NS_ERROR_FAILURE; } - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); JS::AutoValueVector args(cx); diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp index 5c914d880458..12220a5d554f 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp @@ -97,7 +97,6 @@ nsJSUtils::CompileFunction(AutoJSAPI& jsapi, const nsAString& aBody, JSObject** aFunctionObject) { - MOZ_ASSERT(jsapi.OwnsErrorReporting()); JSContext* cx = jsapi.cx(); MOZ_ASSERT(js::GetEnterCompartmentDepth(cx) > 0); MOZ_ASSERT_IF(aScopeChain.length() != 0, diff --git a/dom/base/nsScriptLoader.cpp b/dom/base/nsScriptLoader.cpp index f48bb3600e20..e96de9c909b5 100644 --- a/dom/base/nsScriptLoader.cpp +++ b/dom/base/nsScriptLoader.cpp @@ -829,7 +829,6 @@ nsScriptLoader::AttemptAsyncScriptCompile(nsScriptLoadRequest* aRequest) if (!jsapi.Init(globalObject)) { return NS_ERROR_FAILURE; } - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); JS::Rooted global(cx, globalObject->GetGlobalJSObject()); diff --git a/dom/bindings/CallbackObject.cpp b/dom/bindings/CallbackObject.cpp index a6431431cb97..4e52637c6b4b 100644 --- a/dom/bindings/CallbackObject.cpp +++ b/dom/bindings/CallbackObject.cpp @@ -250,7 +250,6 @@ CallbackObject::CallSetup::~CallSetup() if ((mCompartment && mExceptionHandling == eRethrowContentExceptions) || mExceptionHandling == eRethrowExceptions) { mErrorResult.MightThrowJSException(); - MOZ_ASSERT(mAutoEntryScript->OwnsErrorReporting()); if (needToDealWithException) { JS::Rooted exn(mCx); if (mAutoEntryScript->PeekException(&exn) && diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 50a5548a426c..046b376ba19e 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -15793,7 +15793,6 @@ class CGMaplikeOrSetlikeHelperFunctionGenerator(CallbackMember): MOZ_ASSERT(self); AutoJSAPI jsapi; jsapi.Init(); - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); // It's safe to use UnprivilegedJunkScopeOrWorkerGlobal here because // all we want is to wrap into _some_ scope and then unwrap to find diff --git a/dom/bindings/Exceptions.cpp b/dom/bindings/Exceptions.cpp index 8a9dfb82dbfb..b494bbd665fb 100644 --- a/dom/bindings/Exceptions.cpp +++ b/dom/bindings/Exceptions.cpp @@ -142,7 +142,6 @@ ThrowAndReport(nsPIDOMWindowInner* aWindow, nsresult aRv) if (NS_WARN_IF(!jsapi.Init(aWindow))) { return; } - jsapi.TakeOwnershipOfErrorReporting(); Throw(jsapi.cx(), aRv); } diff --git a/dom/canvas/WebGLContextUtils.cpp b/dom/canvas/WebGLContextUtils.cpp index 53f2ec9837fd..270d552d5317 100644 --- a/dom/canvas/WebGLContextUtils.cpp +++ b/dom/canvas/WebGLContextUtils.cpp @@ -89,8 +89,6 @@ WebGLContext::GenerateWarning(const char* fmt, va_list ap) return; } - api.TakeOwnershipOfErrorReporting(); - JSContext* cx = api.cx(); JS_ReportWarning(cx, "WebGL: %s", buf); if (!ShouldGenerateWarnings()) { diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index bcaeb342f20f..ff576f8b993d 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -917,7 +917,6 @@ EventListenerManager::CompileEventHandlerInternal(Listener* aListener, if (NS_WARN_IF(!jsapi.Init(global))) { return NS_ERROR_UNEXPECTED; } - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); nsCOMPtr typeAtom = aListener->mTypeAtom; diff --git a/dom/indexedDB/IDBRequest.cpp b/dom/indexedDB/IDBRequest.cpp index b0297b59c689..beeefebfcb48 100644 --- a/dom/indexedDB/IDBRequest.cpp +++ b/dom/indexedDB/IDBRequest.cpp @@ -376,7 +376,6 @@ IDBRequest::SetResultCallback(ResultCallback* aCallback) return; } } - autoJS.TakeOwnershipOfErrorReporting(); JSContext* cx = autoJS.cx(); diff --git a/dom/mobilemessage/MobileMessageCallback.cpp b/dom/mobilemessage/MobileMessageCallback.cpp index 1b1ace458088..a7d1dee52798 100644 --- a/dom/mobilemessage/MobileMessageCallback.cpp +++ b/dom/mobilemessage/MobileMessageCallback.cpp @@ -258,7 +258,6 @@ MobileMessageCallback::NotifyMessageDeleted(bool *aDeleted, uint32_t aSize) if (NS_WARN_IF(!jsapi.Init(mDOMRequest->GetOwner()))) { return NS_ERROR_FAILURE; } - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); JS::Rooted deleteArrayObj(cx, JS_NewArrayObject(cx, aSize)); diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 4d02981f5712..2e4da8a333e2 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -144,7 +144,6 @@ public: : mAes(aes) , mIsDestroyPending(aWrapper->mDestroyPending) { - MOZ_ASSERT(aes.OwnsErrorReporting()); } ~AutoJSExceptionSuppressor() diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp index fd15526c5162..8e26f2f52b2c 100644 --- a/dom/promise/Promise.cpp +++ b/dom/promise/Promise.cpp @@ -783,7 +783,6 @@ Promise::AppendNativeHandler(PromiseNativeHandler* aRunnable) // happen anyway. return; } - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); JS::Rooted handlerWrapper(cx); @@ -1774,7 +1773,6 @@ public: if (!jsapi.Init(mValues)) { return; } - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); JS::Rooted value(cx, aValue); diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index 1bd179cc72fe..3975636a5b12 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -1770,7 +1770,6 @@ ScriptExecutorRunnable::PreRun(WorkerPrivate* aWorkerPrivate) AutoJSAPI jsapi; jsapi.Init(); - jsapi.TakeOwnershipOfErrorReporting(); WorkerGlobalScope* globalScope = aWorkerPrivate->GetOrCreateGlobalScope(jsapi.cx()); diff --git a/dom/workers/ServiceWorkerEvents.cpp b/dom/workers/ServiceWorkerEvents.cpp index 29f457ae8d27..2f1e4011b0c2 100644 --- a/dom/workers/ServiceWorkerEvents.cpp +++ b/dom/workers/ServiceWorkerEvents.cpp @@ -920,7 +920,6 @@ ExtendableEvent::GetPromise() if (!jsapi.Init(globalObj)) { return nullptr; } - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); GlobalObject global(cx, globalObj->GetGlobalJSObject()); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 3aff368bba86..5886bf9d4aff 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -4407,7 +4407,6 @@ WorkerPrivate::DoRunLoop(JSContext* aCx) AutoJSAPI jsapi; jsapi.Init(); MOZ_ASSERT(jsapi.cx() == aCx); - jsapi.TakeOwnershipOfErrorReporting(); EnableMemoryReporter(); diff --git a/dom/workers/WorkerRunnable.cpp b/dom/workers/WorkerRunnable.cpp index 6f4204436f40..ad8a882cb129 100644 --- a/dom/workers/WorkerRunnable.cpp +++ b/dom/workers/WorkerRunnable.cpp @@ -327,7 +327,6 @@ WorkerRunnable::Run() maybeJSAPI->Init(); jsapi = maybeJSAPI.ptr(); cx = jsapi->cx(); - jsapi->TakeOwnershipOfErrorReporting(); } // Note that we can't assert anything about mWorkerPrivate->GetWrapper() diff --git a/dom/workers/XMLHttpRequest.cpp b/dom/workers/XMLHttpRequest.cpp index 7f8b2fefb6c9..94167f5e8f1b 100644 --- a/dom/workers/XMLHttpRequest.cpp +++ b/dom/workers/XMLHttpRequest.cpp @@ -1195,7 +1195,6 @@ EventRunnable::PreDispatch(WorkerPrivate* /* unused */) AutoJSAPI jsapi; DebugOnly ok = jsapi.Init(xpc::NativeGlobal(mScopeObj)); MOZ_ASSERT(ok); - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); // Now keep the mScopeObj alive for the duration JS::Rooted scopeObj(cx, mScopeObj); diff --git a/dom/xbl/nsXBLProtoImpl.cpp b/dom/xbl/nsXBLProtoImpl.cpp index 3d787f6fa26d..3218e45ae933 100644 --- a/dom/xbl/nsXBLProtoImpl.cpp +++ b/dom/xbl/nsXBLProtoImpl.cpp @@ -245,7 +245,6 @@ nsXBLProtoImpl::CompilePrototypeMembers(nsXBLPrototypeBinding* aBinding) AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(xpc::CompilationScope()))) return NS_ERROR_FAILURE; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); mPrecompiledMemberHolder = JS_NewObjectWithGivenProto(cx, nullptr, nullptr); diff --git a/dom/xbl/nsXBLPrototypeHandler.cpp b/dom/xbl/nsXBLPrototypeHandler.cpp index 1e158a3dc3a7..894864c7bb84 100644 --- a/dom/xbl/nsXBLPrototypeHandler.cpp +++ b/dom/xbl/nsXBLPrototypeHandler.cpp @@ -274,7 +274,6 @@ nsXBLPrototypeHandler::ExecuteHandler(EventTarget* aTarget, if (NS_WARN_IF(!jsapi.Init(boundGlobal))) { return NS_OK; } - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); JS::Rooted handler(cx); diff --git a/js/ipc/WrapperAnswer.cpp b/js/ipc/WrapperAnswer.cpp index d4ecd7e101b1..07be205c86b2 100644 --- a/js/ipc/WrapperAnswer.cpp +++ b/js/ipc/WrapperAnswer.cpp @@ -78,7 +78,6 @@ WrapperAnswer::RecvPreventExtensions(const ObjectId& objId, ReturnStatus* rs) AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject obj(cx, findObjectById(cx, objId)); @@ -110,7 +109,6 @@ WrapperAnswer::RecvGetPropertyDescriptor(const ObjectId& objId, const JSIDVarian AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); EmptyDesc(out); @@ -141,7 +139,6 @@ WrapperAnswer::RecvGetOwnPropertyDescriptor(const ObjectId& objId, const JSIDVar AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); EmptyDesc(out); @@ -172,7 +169,6 @@ WrapperAnswer::RecvDefineProperty(const ObjectId& objId, const JSIDVariant& idVa AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject obj(cx, findObjectById(cx, objId)); @@ -201,7 +197,6 @@ WrapperAnswer::RecvDelete(const ObjectId& objId, const JSIDVariant& idVar, Retur AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject obj(cx, findObjectById(cx, objId)); @@ -227,7 +222,6 @@ WrapperAnswer::RecvHas(const ObjectId& objId, const JSIDVariant& idVar, ReturnSt AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); *foundp = false; @@ -253,7 +247,6 @@ WrapperAnswer::RecvHasOwn(const ObjectId& objId, const JSIDVariant& idVar, Retur AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); *foundp = false; @@ -349,7 +342,6 @@ WrapperAnswer::RecvIsExtensible(const ObjectId& objId, ReturnStatus* rs, bool* r AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); *result = false; @@ -479,7 +471,6 @@ WrapperAnswer::RecvHasInstance(const ObjectId& objId, const JSVariant& vVar, Ret AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject obj(cx, findObjectById(cx, objId)); @@ -507,7 +498,6 @@ WrapperAnswer::RecvGetBuiltinClass(const ObjectId& objId, ReturnStatus* rs, AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject obj(cx, findObjectById(cx, objId)); @@ -533,7 +523,6 @@ WrapperAnswer::RecvIsArray(const ObjectId& objId, ReturnStatus* rs, AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject obj(cx, findObjectById(cx, objId)); @@ -556,7 +545,6 @@ WrapperAnswer::RecvClassName(const ObjectId& objId, nsCString* name) AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject obj(cx, findObjectById(cx, objId)); @@ -579,7 +567,6 @@ WrapperAnswer::RecvGetPrototype(const ObjectId& objId, ReturnStatus* rs, ObjectO AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject obj(cx, findObjectById(cx, objId)); @@ -605,7 +592,6 @@ WrapperAnswer::RecvRegExpToShared(const ObjectId& objId, ReturnStatus* rs, AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject obj(cx, findObjectById(cx, objId)); @@ -632,7 +618,6 @@ WrapperAnswer::RecvGetPropertyKeys(const ObjectId& objId, const uint32_t& flags, AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject obj(cx, findObjectById(cx, objId)); @@ -663,7 +648,6 @@ WrapperAnswer::RecvInstanceOf(const ObjectId& objId, const JSIID& iid, ReturnSta AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); *instanceof = false; @@ -691,7 +675,6 @@ WrapperAnswer::RecvDOMInstanceOf(const ObjectId& objId, const int& prototypeID, AutoJSAPI jsapi; if (NS_WARN_IF(!jsapi.Init(scopeForTargetObjects()))) return false; - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); *instanceof = false; diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index 13089758411a..997a57d0b067 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -365,7 +365,6 @@ mozJSComponentLoader::LoadModule(FileLocation& aFile) dom::AutoJSAPI jsapi; jsapi.Init(); - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); nsAutoPtr entry(new ModuleEntry(cx)); @@ -655,7 +654,6 @@ mozJSComponentLoader::ObjectForLocation(ComponentLoaderInfo& aInfo, dom::AutoJSAPI jsapi; jsapi.Init(); - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); bool realFile = false; @@ -983,7 +981,6 @@ mozJSComponentLoader::UnloadModules() dom::AutoJSAPI jsapi; jsapi.Init(); - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); RootedObject global(cx, mLoaderGlobal->GetJSObject()); if (global) { @@ -1217,7 +1214,6 @@ mozJSComponentLoader::ImportInto(const nsACString& aLocation, // not an AutoEntryScript. dom::AutoJSAPI jsapi; jsapi.Init(); - jsapi.TakeOwnershipOfErrorReporting(); JSContext* cx = jsapi.cx(); JSAutoCompartment ac(cx, mod->obj);