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 24898 b3b5e2a64382bb6c2ff24d363a6ab1177d0d826f
parent 24897 e7403f2cbd61516d54982dc155f54483ea4e5d87
child 24899 07f24650db8f1d84b448704fbc73ebefb264915f
push id1267
push userrsayre@mozilla.com
push dateSun, 19 Apr 2009 02:47:24 +0000
reviewersigor
bugs469237
milestone1.9.1b4pre
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);