[JAEGER] Bug 585749 temporary fix: update cached native iterator's shape array when creating the cache entry

This commit is contained in:
David Mandelin
2010-08-09 15:26:19 -07:00
parent f791e10261
commit a0e3c32871
2 changed files with 11 additions and 1 deletions

View File

@@ -808,6 +808,16 @@ js_CloseIterator(JSContext *cx, JSObject *obj)
if (ni->shapes_length) {
uint32 hash = ni->shapes_key % NATIVE_ITER_CACHE_SIZE;
JSObject **hp = &JS_THREAD_DATA(cx)->cachedNativeIterators[hash];
JSObject *pobj = obj;
int i = 0;
do {
ni->shapes_array[i] = pobj->shape();
++i;
pobj = pobj->getProto();
} while (pobj);
ni->shapes_length = i;
ni->props_cursor = ni->props_array;
ni->next = *hp;
*hp = obj;