Bug 797583 - Remove bogus assertion. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Thu, 04 Oct 2012 11:56:51 +0200
changeset 109220 a055a290f2662d4b1e48a65c763b79e02af5353b
parent 109219 38b9f2f85de0a615e784a99612323e478a25d708
child 109221 ee9f796b8416072d1387a625ff07dd613c80b907
push id15910
push userbobbyholley@gmail.com
push dateThu, 04 Oct 2012 09:57:25 +0000
treeherdermozilla-inbound@a055a290f266 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs797583
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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);