Bug 469237: Assert that we never add properties to lexical blocks. r=igor
authorJim Blandy <jimb@mozilla.org>
Thu, 09 Apr 2009 13:07:27 -0700
changeset 27162 e1a26ef353c403eeef3c550ac2ac9fddd3fb3266
parent 27112 d9eafbebdd78b9a10384de9815a29bf90bbc653d
child 27163 3d7e030e283f05d9547a2b69a4523cd735ce622e
push id6416
push userrsayre@mozilla.com
push dateFri, 10 Apr 2009 08:17:12 +0000
treeherdermozilla-central@99d61ba5f125 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersigor
bugs469237
milestone1.9.2a1pre
Bug 469237: Assert that we never add properties to lexical blocks. r=igor
js/src/jsobj.cpp
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -4482,16 +4482,19 @@ js_SetPropertyHelper(JSContext *cx, JSOb
         }
 #ifdef __GNUC__ /* suppress bogus gcc warnings */
     } else {
         scope = NULL;
 #endif
     }
 
     if (!sprop) {
+        /* We should never add properties to lexical blocks.  */
+        JS_ASSERT(OBJ_GET_CLASS(cx, obj) != &js_BlockClass);
+
         /*
          * Purge the property cache of now-shadowed id in obj's scope chain.
          * Do this early, before locking obj to avoid nesting locks.
          */
         js_PurgeScopeChain(cx, obj, id);
 
         /* Find or make a property descriptor with the right heritage. */
         JS_LOCK_OBJ(cx, obj);