Bug 605696 - Refuse to create location objects without an outer window. r=jst

--HG--
extra : transplant_source : 4%D9%ABJ%0A%03%E5%7D%C5%F1%3C%BDV%BB%E7%E0%CC%DFh%10
This commit is contained in:
Blake Kaplan 2010-10-25 12:13:36 -07:00
parent c7f9cb0697
commit 442be7263a

View File

@ -7095,15 +7095,13 @@ nsLocationSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
}
nsCOMPtr<nsIScriptGlobalObject> sgo = do_GetInterface(ds);
if (sgo) {
JSObject *global = sgo->GetGlobalJSObject();
if (global) {
*parentObj = global;
}
if (!sgo) {
NS_WARNING("Refusing to create a location in the wrong scope because the "
"docshell is being destroyed");
return NS_ERROR_UNEXPECTED;
}
*parentObj = sgo->GetGlobalJSObject();
return NS_OK;
}