Bug 691178 - Refuse to wrap windows that are on the way out. r=jst

This commit is contained in:
Bobby Holley 2012-02-29 18:09:16 -08:00
parent 4a2b90f233
commit d51c4b143c

View File

@ -5147,6 +5147,11 @@ nsWindowSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *winObj = win->FastGetGlobalJSObject();
if (!winObj) {
// See bug 691178 comment 11 for why this is necessary.
if (win->IsClosedOrClosing())
return NS_ERROR_FAILURE;
NS_ASSERTION(win->GetOuterWindowInternal()->IsCreatingInnerWindow(),
"should have a JS object by this point");
return NS_OK;