[INFER] Move inference methods out of JSContext, bug 657412.

This commit is contained in:
Brian Hackett
2011-06-02 10:40:27 -07:00
parent e7c78c3859
commit 0effc78aae
38 changed files with 956 additions and 854 deletions

View File

@@ -382,7 +382,7 @@ GetCustomIterator(JSContext *cx, JSObject *obj, uintN flags, Value *vp)
* that loop are unknown, whether there is a custom __iterator__ or not.
*/
if (!(flags & JSITER_OWNONLY))
cx->markTypeCallerUnexpected(types::TYPE_UNKNOWN);
types::MarkTypeCallerUnexpected(cx, types::TYPE_UNKNOWN);
/* Otherwise call it and return that object. */
LeaveTrace(cx);
@@ -442,7 +442,7 @@ NewIteratorObject(JSContext *cx, uintN flags)
EmptyShape *emptyEnumeratorShape = EmptyShape::getEmptyEnumeratorShape(cx);
if (!emptyEnumeratorShape)
return NULL;
obj->init(cx, &js_IteratorClass, cx->getTypeEmpty(), NULL, NULL, false);
obj->init(cx, &js_IteratorClass, types::GetTypeEmpty(cx), NULL, NULL, false);
obj->setMap(emptyEnumeratorShape);
return obj;
}
@@ -495,7 +495,7 @@ VectorToKeyIterator(JSContext *cx, JSObject *obj, uintN flags, AutoIdVector &key
JS_ASSERT(!(flags & JSITER_FOREACH));
if (obj)
cx->markTypeObjectFlags(obj->getType(), types::OBJECT_FLAG_ITERATED);
types::MarkTypeObjectFlags(cx, obj->getType(), types::OBJECT_FLAG_ITERATED);
JSObject *iterobj = NewIteratorObject(cx, flags);
if (!iterobj)
@@ -545,7 +545,7 @@ VectorToValueIterator(JSContext *cx, JSObject *obj, uintN flags, AutoIdVector &k
JS_ASSERT(flags & JSITER_FOREACH);
if (obj)
cx->markTypeObjectFlags(obj->getType(), types::OBJECT_FLAG_ITERATED);
types::MarkTypeObjectFlags(cx, obj->getType(), types::OBJECT_FLAG_ITERATED);
JSObject *iterobj = NewIteratorObject(cx, flags);
if (!iterobj)
@@ -1498,6 +1498,6 @@ js_InitIteratorClasses(JSContext *cx, JSObject *obj)
proto = js_InitClass(cx, obj, NULL, &js_StopIterationClass, NULL, 0, NULL,
NULL, NULL, NULL, NULL);
if (proto)
cx->addTypeProperty(obj->getType(), js_StopIteration_str, ObjectValue(*proto));
types::AddTypeProperty(cx, obj->getType(), js_StopIteration_str, ObjectValue(*proto));
return proto;
}