Bug 457920 - regexp-dna.js and generality want JSOP_GETELEM(dense array, "0") (r=mrbkap/gal).

This commit is contained in:
Brendan Eich
2008-10-06 22:30:36 -07:00
parent 8e95510025
commit 24a9ca408b
6 changed files with 102 additions and 51 deletions

View File

@@ -324,6 +324,13 @@ js_SetProtoOrParent(JSContext *cx, JSObject *obj, uint32 slot, JSObject *pobj)
}
return JS_FALSE;
}
// Maintain the "any Array prototype has indexed properties hazard" flag.
if (slot == JSSLOT_PROTO &&
OBJ_IS_ARRAY(cx, pobj) &&
pobj->fslots[JSSLOT_ARRAY_LENGTH] != 0) {
rt->anyArrayProtoHasElement = JS_TRUE;
}
return JS_TRUE;
}