bug 534493 - avoiding too much debug checks in JSScope::removeProperty. r=brendan

This commit is contained in:
Igor Bukanov 2009-12-13 21:46:37 +03:00
parent 2c1104d609
commit cdb4827341

View File

@ -1594,7 +1594,13 @@ JSScope::removeProperty(JSContext *cx, jsid id)
if (table) {
*spp = NULL;
#ifdef DEBUG
for (JSScopeProperty *aprop = lastProp; aprop; aprop = aprop->parent)
/*
* Check the consistency of the table but limit the number of
* checks not to alter significantly the complexity of the delete
* in debug builds, see bug 534493.
*/
JSScopeProperty *aprop = lastProp;
for (unsigned n = 50; aprop && n != 0; aprop = aprop->parent, --n)
JS_ASSERT_IF(aprop != sprop, hasProperty(aprop));
#endif
}