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

--HG--
extra : rebase_source : 1666f3d4a81c37d6e09890651b204b466d2591bd
This commit is contained in:
Blake Kaplan 2010-10-25 12:13:36 -07:00
Родитель a735277006
Коммит f3be4765a0
1 изменённых файлов: 5 добавлений и 7 удалений

Просмотреть файл

@ -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;
}