Bug 611401 - Avoid potential problems by doing this wrapping ourselves. r=gal
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 02 Dec 2010 14:34:13 -0800
changeset 58705 3e97742e029ae459ecf99ef309cd2d9d477209ba
parent 58704 cd4718b986c8d9eaf5e92293af7152e395c7198b
child 58706 017a0aaab2450baaab7401b71dbd33f74e4201f3
push id17407
push userrsayre@mozilla.com
push dateMon, 06 Dec 2010 22:03:37 +0000
treeherdermozilla-central@2f96714fd6d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal
bugs611401
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 611401 - Avoid potential problems by doing this wrapping ourselves. r=gal
js/src/xpconnect/src/xpccomponents.cpp
--- a/js/src/xpconnect/src/xpccomponents.cpp
+++ b/js/src/xpconnect/src/xpccomponents.cpp
@@ -3232,20 +3232,19 @@ xpc_CreateSandboxObject(JSContext * cx, 
             return NS_ERROR_XPC_UNEXPECTED;
 
         if (proto) {
             bool ok = JS_WrapObject(cx, &proto);
             if (!ok)
                 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);
             }
 
             ok = JS_SetPrototype(cx, sandbox, proto);
             if (!ok)
                 return NS_ERROR_XPC_UNEXPECTED;
         }