static bool IterNext(JSContext *cx, unsigned argc, jsval *vp) { if (iterCount++ == 100) return JS_ThrowStopIteration(cx); JS_SET_RVAL(cx, vp, INT_TO_JSVAL(iterCount)); return true; }
static JSBool IterNext(JSContext *cx, uintN argc, jsval *vp) { if (count++ == 100) return JS_ThrowStopIteration(cx); JS_SET_RVAL(cx, vp, INT_TO_JSVAL(count)); return true; }