Bug 699565 - Part 3 - for-of loops on wrappers. r=bhackett.

This commit is contained in:
Jason Orendorff
2012-02-07 12:57:16 -06:00
parent 774282f9ae
commit c1c36f610b
6 changed files with 57 additions and 0 deletions

View File

@@ -1243,6 +1243,13 @@ js_IteratorMore(JSContext *cx, JSObject *iterobj, Value *rval)
rval->setBoolean(false);
return true;
}
} else if (iterobj->isProxy()) {
if (!Proxy::iteratorNext(cx, iterobj, rval))
return false;
if (rval->isMagic(JS_NO_ITER_VALUE)) {
rval->setBoolean(false);
return true;
}
} else {
/* Call the iterator object's .next method. */
jsid id = ATOM_TO_JSID(cx->runtime->atomState.nextAtom);