[tor-commits] [tor-browser/esr24] Bug 980537 - Only store FakeBackstagePass instances in mThisObjects. r=khuey, a=sledru

mikeperry at torproject.org mikeperry at torproject.org
Fri Aug 29 05:26:39 UTC 2014


commit 00d381db6844041ac1a6e3b8b6a9e2e1829c56fc
Author: Bobby Holley <bobbyholley at gmail.com>
Date:   Sun Apr 6 12:32:39 2014 -0700

    Bug 980537 - Only store FakeBackstagePass instances in mThisObjects. r=khuey, a=sledru
---
 js/xpconnect/loader/mozJSComponentLoader.cpp |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp
index 06e3a30..ddc74ef 100644
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -614,7 +614,9 @@ mozJSComponentLoader::NoteSubScript(HandleScript aScript, HandleObject aThisObje
       MOZ_CRASH();
   }
 
-  mThisObjects.Put(aScript, aThisObject);
+  if (js::GetObjectJSClass(aThisObject) == &kFakeBackstagePassJSClass) {
+    mThisObjects.Put(aScript, aThisObject);
+  }
 }
 
 // Some stack based classes for cleaning up on early return
@@ -1024,7 +1026,10 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile,
         MOZ_ASSERT(tableScript);
     }
 
-    mThisObjects.Put(tableScript, obj);
+    if (js::GetObjectJSClass(obj) == &kFakeBackstagePassJSClass) {
+        MOZ_ASSERT(mReuseLoaderGlobal);
+        mThisObjects.Put(tableScript, obj);
+    }
 
     uint32_t oldopts = JS_GetOptions(cx);
     JS_SetOptions(cx, oldopts | (aPropagateExceptions ? JSOPTION_DONT_REPORT_UNCAUGHT : 0));





More information about the tor-commits mailing list