Bug 611401 - Avoid potential problems by doing this wrapping ourselves. r=gal

This commit is contained in:
Blake Kaplan 2010-12-02 14:34:13 -08:00
parent f0e729dee7
commit 50573f6b31

View File

@ -3237,10 +3237,9 @@ xpc_CreateSandboxObject(JSContext * cx, jsval * vp, nsISupports *prinOrSop, JSOb
return NS_ERROR_XPC_UNEXPECTED;
if (xpc::WrapperFactory::IsXrayWrapper(proto) && !wantXrays) {
jsval v;
if (!JS_GetProperty(cx, proto, "wrappedJSObject", &v))
return NS_ERROR_XPC_UNEXPECTED;
jsval v = OBJECT_TO_JSVAL(proto);
if (!xpc::WrapperFactory::WaiveXrayAndWrap(cx, &v))
return NS_ERROR_FAILURE;
proto = JSVAL_TO_OBJECT(v);
}