[INFER] Lazily create type objects for singleton JS objects, bug 670185.

This commit is contained in:
Brian Hackett
2011-07-15 10:14:07 -07:00
parent 60928a8c51
commit 966e60ebab
56 changed files with 2052 additions and 1947 deletions

View File

@@ -474,7 +474,7 @@ VectorToKeyIterator(JSContext *cx, JSObject *obj, uintN flags, AutoIdVector &key
JS_ASSERT(!(flags & JSITER_FOREACH));
if (obj)
types::MarkTypeObjectFlags(cx, obj->getType(), types::OBJECT_FLAG_ITERATED);
types::MarkTypeObjectFlags(cx, obj, types::OBJECT_FLAG_ITERATED);
JSObject *iterobj = NewIteratorObject(cx, flags);
if (!iterobj)
@@ -524,7 +524,7 @@ VectorToValueIterator(JSContext *cx, JSObject *obj, uintN flags, AutoIdVector &k
JS_ASSERT(flags & JSITER_FOREACH);
if (obj)
types::MarkTypeObjectFlags(cx, obj->getType(), types::OBJECT_FLAG_ITERATED);
types::MarkTypeObjectFlags(cx, obj, types::OBJECT_FLAG_ITERATED);
JSObject *iterobj = NewIteratorObject(cx, flags);
if (!iterobj)
@@ -1446,6 +1446,6 @@ js_InitIteratorClasses(JSContext *cx, JSObject *obj)
proto = js_InitClass(cx, obj, NULL, &js_StopIterationClass, NULL, 0,
NULL, NULL, NULL, NULL);
if (proto)
types::AddTypeProperty(cx, obj->getType(), js_StopIteration_str, ObjectValue(*proto));
types::AddTypeProperty(cx, obj->type(), js_StopIteration_str, ObjectValue(*proto));
return proto;
}