Compile JSOP_ITER (bug 701965, r=jandem)

This commit is contained in:
Brian Hackett
2012-02-08 11:05:32 +01:00
parent 0249edb76f
commit 67bda865f9
13 changed files with 351 additions and 24 deletions

View File

@@ -770,8 +770,17 @@ GetIterator(JSContext *cx, JSObject *obj, uintN flags, Value *vp)
return true;
}
JSObject *
GetIteratorObject(JSContext *cx, JSObject *obj, uint32_t flags)
{
Value value;
if (!GetIterator(cx, obj, flags, &value))
return NULL;
return &value.toObject();
}
} /* namespace js */
static JSObject *
iterator_iterator(JSContext *cx, JSObject *obj, JSBool keysonly)
{
@@ -875,7 +884,7 @@ static JSBool
CloseGenerator(JSContext *cx, JSObject *genobj);
#endif
JS_FRIEND_API(JSBool)
JS_FRIEND_API(bool)
js_CloseIterator(JSContext *cx, JSObject *obj)
{
cx->iterValue.setMagic(JS_NO_ITER_VALUE);
@@ -1044,7 +1053,7 @@ js_SuppressDeletedElements(JSContext *cx, JSObject *obj, uint32_t begin, uint32_
return SuppressDeletedPropertyHelper(cx, obj, IndexRangePredicate(begin, end));
}
JSBool
bool
js_IteratorMore(JSContext *cx, JSObject *iterobj, Value *rval)
{
/* Fast path for native iterators */
@@ -1103,7 +1112,7 @@ js_IteratorMore(JSContext *cx, JSObject *iterobj, Value *rval)
return true;
}
JSBool
bool
js_IteratorNext(JSContext *cx, JSObject *iterobj, Value *rval)
{
/* Fast path for native iterators */