зеркало из https://github.com/mozilla/gecko-dev.git
Bug 605696 - Refuse to create location objects without an outer window. r=jst
--HG-- extra : rebase_source : 1666f3d4a81c37d6e09890651b204b466d2591bd
This commit is contained in:
Родитель
a735277006
Коммит
f3be4765a0
|
@ -7095,15 +7095,13 @@ nsLocationSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIScriptGlobalObject> sgo = do_GetInterface(ds);
|
nsCOMPtr<nsIScriptGlobalObject> sgo = do_GetInterface(ds);
|
||||||
|
if (!sgo) {
|
||||||
if (sgo) {
|
NS_WARNING("Refusing to create a location in the wrong scope because the "
|
||||||
JSObject *global = sgo->GetGlobalJSObject();
|
"docshell is being destroyed");
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
if (global) {
|
|
||||||
*parentObj = global;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*parentObj = sgo->GetGlobalJSObject();
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче