Bug 469621 - Protect the new scope object from garbage collection. r=crowder
authorBlake Kaplan <mrbkap@gmail.com>
Mon, 15 Dec 2008 16:42:40 -0800
changeset 23070 5f6d7c789505f032c0de4071b273263305efd364
parent 23069 7010a2955de37da4b1a4ce28e9e61f21548d7e2e
child 23071 fae33a19dbe996e5978f11a4188d3e71ecd08db5
push id4346
push userrsayre@mozilla.com
push dateFri, 26 Dec 2008 01:26:36 +0000
treeherdermozilla-central@8eb5a5b83a93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscrowder
bugs469621
milestone1.9.2a1pre
Bug 469621 - Protect the new scope object from garbage collection. r=crowder
js/src/jsobj.cpp
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -1306,16 +1306,17 @@ obj_eval(JSContext *cx, JSObject *obj, u
             goto out;
 
         scopeobj = js_NewWithObject(cx, scopeobj,
                                     JS_GetGlobalForObject(cx, scopeobj), -1);
         if (!scopeobj) {
             ok = JS_FALSE;
             goto out;
         }
+        argv[1] = OBJECT_TO_JSVAL(scopeobj);
     }
 
     /* Ensure we compile this eval with the right object in the scope chain. */
     scopeobj = js_CheckScopeChainValidity(cx, scopeobj, js_eval_str);
     if (!scopeobj) {
         ok = JS_FALSE;
         goto out;
     }