Bug 612836 - Second verse, same as the first (see also bug 602223): Use the global object instead of the parent so we're sure to have a non-null parent. r=gal, a=blocker
authorBlake Kaplan <mrbkap@gmail.com>
Mon, 29 Nov 2010 13:37:01 -0800
changeset 58346 345dd13d047bfba2d3796e72779627d1771e1625
parent 58345 650ad3cd7e520eb93ba73ecedc40212d4c81efb0
child 58347 70489f92c25fec38f8b0184723756b945b91ce9a
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersgal, blocker
bugs612836, 602223
milestone2.0b8pre
Bug 612836 - Second verse, same as the first (see also bug 602223): Use the global object instead of the parent so we're sure to have a non-null parent. r=gal, a=blocker
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -4147,17 +4147,17 @@ Wrap(JSContext *cx, uintN argc, jsval *v
 {
     jsval v = argc > 0 ? JS_ARGV(cx, vp)[0] : JSVAL_VOID;
     if (JSVAL_IS_PRIMITIVE(v)) {
         JS_SET_RVAL(cx, vp, v);
         return true;
     }
 
     JSObject *obj = JSVAL_TO_OBJECT(v);
-    JSObject *wrapped = JSWrapper::New(cx, obj, obj->getProto(), obj->getParent(),
+    JSObject *wrapped = JSWrapper::New(cx, obj, obj->getProto(), obj->getGlobal(),
                                        &JSWrapper::singleton);
     if (!wrapped)
         return false;
 
     JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(wrapped));
     return true;
 }