Bug 487430 - call_enumerate doesn't take upvars into account. r=brendan
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 14 Apr 2009 11:29:34 -0700
changeset 24917 9a8b99104f1e57962b28a836d4798e0a8c6ace5a
parent 24916 dded8cfa2a35ebfafb7e63c865e4c9757e374c80
child 24918 3f730f8ba0271dafc89f50ec8d710e24f122a06c
push id1267
push userrsayre@mozilla.com
push dateSun, 19 Apr 2009 02:47:24 +0000
reviewersbrendan
bugs487430
milestone1.9.1b4pre
Bug 487430 - call_enumerate doesn't take upvars into account. r=brendan
js/src/jsfun.cpp
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -767,22 +767,24 @@ call_enumerate(JSContext *cx, JSObject *
          * Trigger reflection by looking up the name of the argument or
          * variable.
          */
         ok = js_LookupProperty(cx, obj, ATOM_TO_JSID(name), &pobj, &prop);
         if (!ok)
             goto out;
 
         /*
-         * At this point the call object always has a property corresponding
-         * to the local name because call_resolve creates the property using
-         * JSPROP_PERMANENT.
+         * If this local name was not an upvar name, the call object will
+         * always have a property corresponding to the local name because
+         * call_resolve creates the property using JSPROP_PERMANENT.
          */
-        JS_ASSERT(prop && pobj == obj);
-        OBJ_DROP_PROPERTY(cx, pobj, prop);
+        if (prop) {
+            JS_ASSERT(pobj == obj);
+            OBJ_DROP_PROPERTY(cx, pobj, prop);
+        }
     }
     ok = JS_TRUE;
 
   out:
     JS_ARENA_RELEASE(&cx->tempPool, mark);
     return ok;
 }