Make empty shape initialization lazy (bug 639254, r=billm).

This commit is contained in:
Andreas Gal
2011-03-07 18:42:04 -08:00
parent ff2cf310e5
commit 7480ccb2dd
16 changed files with 126 additions and 124 deletions

View File

@@ -424,8 +424,13 @@ NewIteratorObject(JSContext *cx, uintN flags)
JSObject *obj = js_NewGCObject(cx, FINALIZE_OBJECT0);
if (!obj)
return false;
EmptyShape *emptyEnumeratorShape = EmptyShape::getEmptyEnumeratorShape(cx);
if (!emptyEnumeratorShape)
return NULL;
obj->init(cx, &js_IteratorClass, NULL, NULL, NULL, false);
obj->setMap(cx->compartment->emptyEnumeratorShape);
obj->setMap(emptyEnumeratorShape);
return obj;
}