Bug 435345 - Cannot accurately watch the 'length' property of arrays, r=shaver

This commit is contained in:
2008-07-01 12:47:09 -07:00
parent c290f36e91
commit f412ce8864
3 changed files with 12 additions and 9 deletions

View File

@@ -1434,6 +1434,9 @@ obj_watch(JSContext *cx, uintN argc, jsval *vp)
if (attrs & JSPROP_READONLY)
return JS_TRUE;
*vp = JSVAL_VOID;
if (OBJ_IS_DENSE_ARRAY(cx, obj) && !js_MakeArraySlow(cx, obj))
return JS_FALSE;
return JS_SetWatchPoint(cx, obj, userid, obj_watch_handler, callable);
}