Beispiel #1
0
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;
}
Beispiel #2
0
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;
}