From 371e0dbf74934fb5bbde94cf610a40038124b2c3 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Fri, 18 Feb 2011 20:54:47 -0800 Subject: [PATCH] Followup fix for bug 631135 to use the right method to compute calling scope when calling evalInSandbox. r=mrbkap, a=reported-extension-bustage --- js/src/xpconnect/src/xpccomponents.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/js/src/xpconnect/src/xpccomponents.cpp b/js/src/xpconnect/src/xpccomponents.cpp index 17837aa5b1af..16004d5d229a 100644 --- a/js/src/xpconnect/src/xpccomponents.cpp +++ b/js/src/xpconnect/src/xpccomponents.cpp @@ -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; } }