Bug 797583 - Remove bogus assertion. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Thu, 04 Oct 2012 11:56:51 +0200
changeset 115533 a055a290f2662d4b1e48a65c763b79e02af5353b
parent 115532 38b9f2f85de0a615e784a99612323e478a25d708
child 115534 ee9f796b8416072d1387a625ff07dd613c80b907
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersmrbkap
bugs797583
milestone18.0a1
Bug 797583 - Remove bogus assertion. r=mrbkap
js/xpconnect/crashtests/797583.html
js/xpconnect/crashtests/crashtests.list
js/xpconnect/src/XPCComponents.cpp
new file mode 100644
--- /dev/null
+++ b/js/xpconnect/crashtests/797583.html
@@ -0,0 +1,6 @@
+<script>
+
+var ww = Object.create(window);
+ww.Components;
+
+</script>
--- a/js/xpconnect/crashtests/crashtests.list
+++ b/js/xpconnect/crashtests/crashtests.list
@@ -41,8 +41,9 @@ load 732870.html
 load 751995.html
 load 761831.html
 asserts(0-1) load 752038.html # We may hit bug 645229 here.
 asserts(1) load 753162.html # We hit bug 675518 or bug 680086 here.
 load 754311.html
 load 776328.html
 load 776333.html
 load 791845.html
+load 797583.html
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -4782,19 +4782,17 @@ ContentComponentsGetterOp(JSContext *cx,
 
     // If the caller is XBL, this is ok.
     if (AccessCheck::callerIsXBL(cx))
         return true;
 
     // Do Telemetry on how often this happens.
     Telemetry::Accumulate(Telemetry::COMPONENTS_OBJECT_ACCESSED_BY_CONTENT, true);
 
-    // Warn once. Note that if somebody does window.Components we may have an
-    // outer window here.
-    MOZ_ASSERT(JS_GetGlobalForObject(cx, obj) == JS_ObjectToInnerObject(cx, obj));
+    // Warn once.
     JSAutoCompartment ac(cx, obj);
     nsCOMPtr<nsPIDOMWindow> win =
         do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(cx, obj));
     if (win) {
         nsCOMPtr<nsIDocument> doc =
             do_QueryInterface(win->GetExtantDocument());
         if (doc)
             doc->WarnOnceAbout(nsIDocument::eComponents, /* asError = */ true);