зеркало из https://github.com/mozilla/gecko-dev.git
Followup fix for bug 631135 to use the right method to compute calling scope when calling evalInSandbox. r=mrbkap, a=reported-extension-bustage
This commit is contained in:
Родитель
e22a41f05e
Коммит
371e0dbf74
|
@ -3630,16 +3630,9 @@ xpc_EvalInSandbox(JSContext *cx, JSObject *sandbox, const nsAString& source,
|
|||
{
|
||||
JSAutoRequest req(cx);
|
||||
|
||||
if (!JS_GetGlobalForCallingScript(cx, &callingScope)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
callingScope = JS_GetGlobalForScopeChain(cx);
|
||||
if (!callingScope) {
|
||||
callingScope = JS_GetGlobalObject(cx);
|
||||
if (!callingScope)
|
||||
return NS_ERROR_FAILURE;
|
||||
OBJ_TO_INNER_OBJECT(cx, callingScope);
|
||||
if (!callingScope)
|
||||
return NS_ERROR_FAILURE;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче