diff --git a/js/xpconnect/crashtests/797583.html b/js/xpconnect/crashtests/797583.html new file mode 100644 index 000000000000..f6aaf01c227e --- /dev/null +++ b/js/xpconnect/crashtests/797583.html @@ -0,0 +1,6 @@ + diff --git a/js/xpconnect/crashtests/crashtests.list b/js/xpconnect/crashtests/crashtests.list index 0c23ac23a6fb..2ff4a741aa96 100644 --- a/js/xpconnect/crashtests/crashtests.list +++ b/js/xpconnect/crashtests/crashtests.list @@ -46,3 +46,4 @@ load 754311.html load 776328.html load 776333.html load 791845.html +load 797583.html diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 36e7ce510ef3..1c9db1519ffa 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -4787,9 +4787,7 @@ ContentComponentsGetterOp(JSContext *cx, JSHandleObject obj, JSHandleId id, // 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 win = do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(cx, obj));