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 id17255
push userjst@mozilla.com
push dateMon, 29 Nov 2010 21:37:57 +0000
treeherdermozilla-central@345dd13d047b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal, blocker
bugs612836, 602223
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 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;
 }