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:
Jeff Walden 2011-02-18 20:54:47 -08:00
Родитель e22a41f05e
Коммит 371e0dbf74
1 изменённых файлов: 2 добавлений и 9 удалений

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

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