From 1ed03a415f91f9228d13092b67799399859389b6 Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Mon, 15 May 2017 15:51:20 -0700 Subject: [PATCH] Bug 989373, part 8 - mLoaderGlobal is always null. r=kmag This field can be eliminated for now. MozReview-Commit-ID: 9xyxoTwBfXU --HG-- extra : rebase_source : e71660452286d383ba9738e7c0f7e09ae134a01e --- js/xpconnect/loader/mozJSComponentLoader.cpp | 9 ++------- js/xpconnect/loader/mozJSComponentLoader.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index eed053c640db..a0837ab7c37c 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -531,14 +531,9 @@ mozJSComponentLoader::PrepareObjectForLocation(JSContext* aCx, nsIURI* aURI, bool* aRealFile) { - bool createdNewGlobal = false; RootedObject globalObj(aCx); - if (!mLoaderGlobal) { - CreateLoaderGlobal(aCx, MapURIToAddonID(aURI), &globalObj); - if (globalObj) - createdNewGlobal = true; - } + CreateLoaderGlobal(aCx, MapURIToAddonID(aURI), &globalObj); // |thisObj| is the object we set properties on for a particular .jsm. // XXX Right now, thisObj is always globalObj, but if we start @@ -590,7 +585,7 @@ mozJSComponentLoader::PrepareObjectForLocation(JSContext* aCx, if (!JS_DefineProperty(aCx, thisObj, "__URI__", exposedUri, 0)) return nullptr; - if (createdNewGlobal) { + { // AutoEntryScript required to invoke debugger hook, which is a // Gecko-specific concept at present. dom::AutoEntryScript aes(globalObj, diff --git a/js/xpconnect/loader/mozJSComponentLoader.h b/js/xpconnect/loader/mozJSComponentLoader.h index 0af2e4a5c4e2..a74def2b7371 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.h +++ b/js/xpconnect/loader/mozJSComponentLoader.h @@ -86,7 +86,6 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, nsCOMPtr mCompMgr; nsCOMPtr mSystemPrincipal; - nsCOMPtr mLoaderGlobal; class ModuleEntry : public mozilla::Module {