Fix an incorrect comment (r=me).
Fix an incorrect comment (r=me).
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -413,19 +413,18 @@ js_ValueToIterator(JSContext *cx, uintN
if ((iterobj = JS_THREAD_DATA(cx)->cachedIteratorObject) != NULL) {
JS_THREAD_DATA(cx)->cachedIteratorObject = NULL;
} else {
if (!(iterobj = NewObjectWithGivenProto(cx, &js_IteratorClass, NULL, NULL)))
return false;
}
} else {
/*
- * These objects don't escape either, but we construct a
- * StopIteration exception based on the parent of the iterator
- * object, so we need the correct parent here.
+ * These iterator objects can escape, so we have to construct
+ * them with the proper proto and parent.
*/
if (!(iterobj = NewObject(cx, &js_IteratorClass, NULL, NULL)))
return false;
}
/* Store in *vp to protect it from GC (callers must root vp). */
*vp = OBJECT_TO_JSVAL(iterobj);