From: Fabrice Bellard Date: Sat, 10 Oct 2026 12:14:21 +0000 (+0200) Subject: removed unused arguments of JS_IteratorNext() X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=4b0addb6da7e8d91154fa00fcdeb724a1f1736aa;p=quickjs.git removed unused arguments of JS_IteratorNext() --- diff --git a/quickjs.c b/quickjs.c index 0aad422..92dc724 100644 --- a/quickjs.c +++ b/quickjs.c @@ -16746,13 +16746,12 @@ static JSValue JS_IteratorNext2(JSContext *ctx, JSValueConst enum_obj, /* Note: always return JS_UNDEFINED when *pdone = TRUE. */ static JSValue JS_IteratorNext(JSContext *ctx, JSValueConst enum_obj, - JSValueConst method, - int argc, JSValueConst *argv, BOOL *pdone) + JSValueConst method, BOOL *pdone) { JSValue obj, value, done_val; int done; - obj = JS_IteratorNext2(ctx, enum_obj, method, argc, argv, &done); + obj = JS_IteratorNext2(ctx, enum_obj, method, 0, NULL, &done); if (JS_IsException(obj)) goto fail; if (likely(done == 0)) { @@ -16848,7 +16847,7 @@ static __exception int js_for_of_next(JSContext *ctx, JSValue *sp, int offset) int done = 1; if (likely(!JS_IsUndefined(sp[offset]))) { - value = JS_IteratorNext(ctx, sp[offset], sp[offset + 1], 0, NULL, &done); + value = JS_IteratorNext(ctx, sp[offset], sp[offset + 1], &done); if (JS_IsException(value)) done = -1; if (done) { @@ -17029,7 +17028,7 @@ static __exception int js_append_enumerate(JSContext *ctx, JSValue *sp) general_case: for (;;) { BOOL done; - value = JS_IteratorNext(ctx, enumobj, method, 0, NULL, &done); + value = JS_IteratorNext(ctx, enumobj, method, &done); if (JS_IsException(value)) goto exception; if (done) { @@ -41053,7 +41052,7 @@ static JSValue js_object_fromEntries(JSContext *ctx, JSValueConst this_val, for(;;) { JSValue key, value, item; - item = JS_IteratorNext(ctx, iter, next_method, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next_method, &done); if (JS_IsException(item)) goto fail; if (done) @@ -41690,7 +41689,7 @@ static JSValue iterator_to_array(JSContext *ctx, JSValueConst items) if (JS_IsException(r)) goto exception; for (k = 0;; k++) { - v = JS_IteratorNext(ctx, iter, next_method, 0, NULL, &done); + v = JS_IteratorNext(ctx, iter, next_method, &done); if (JS_IsException(v)) goto exception_close; if (done) @@ -42016,7 +42015,7 @@ static JSValue js_array_from(JSContext *ctx, JSValueConst this_val, if (JS_IsException(next_method)) goto exception; for (k = 0;; k++) { - v = JS_IteratorNext(ctx, enum_obj, next_method, 0, NULL, &done); + v = JS_IteratorNext(ctx, enum_obj, next_method, &done); if (JS_IsException(v)) goto exception; if (done) @@ -43998,7 +43997,7 @@ static JSValue js_iterator_wrap_next(JSContext *ctx, JSValueConst this_val, if (!it) return JS_EXCEPTION; if (magic == GEN_MAGIC_NEXT) { - return JS_IteratorNext(ctx, it->wrapped_iter, it->wrapped_next, 0, NULL, pdone); + return JS_IteratorNext(ctx, it->wrapped_iter, it->wrapped_next, pdone); } else { method = JS_GetProperty(ctx, it->wrapped_iter, JS_ATOM_return); if (JS_IsException(method)) @@ -44430,7 +44429,7 @@ static JSValue js_iterator_proto_func(JSContext *ctx, JSValueConst this_val, { r = JS_TRUE; for (idx = 0; /*empty*/; idx++) { - item = JS_IteratorNext(ctx, this_val, method, 0, NULL, &done); + item = JS_IteratorNext(ctx, this_val, method, &done); if (JS_IsException(item)) goto fail_no_close; if (done) @@ -44459,7 +44458,7 @@ static JSValue js_iterator_proto_func(JSContext *ctx, JSValueConst this_val, case JS_ITERATOR_HELPER_KIND_FIND: { for (idx = 0; /*empty*/; idx++) { - item = JS_IteratorNext(ctx, this_val, method, 0, NULL, &done); + item = JS_IteratorNext(ctx, this_val, method, &done); if (JS_IsException(item)) goto fail_no_close; if (done) @@ -44492,7 +44491,7 @@ static JSValue js_iterator_proto_func(JSContext *ctx, JSValueConst this_val, case JS_ITERATOR_HELPER_KIND_FOR_EACH: { for (idx = 0; /*empty*/; idx++) { - item = JS_IteratorNext(ctx, this_val, method, 0, NULL, &done); + item = JS_IteratorNext(ctx, this_val, method, &done); if (JS_IsException(item)) goto fail_no_close; if (done) @@ -44516,7 +44515,7 @@ static JSValue js_iterator_proto_func(JSContext *ctx, JSValueConst this_val, { r = JS_FALSE; for (idx = 0; /*empty*/; idx++) { - item = JS_IteratorNext(ctx, this_val, method, 0, NULL, &done); + item = JS_IteratorNext(ctx, this_val, method, &done); if (JS_IsException(item)) goto fail_no_close; if (done) @@ -44581,7 +44580,7 @@ static JSValue js_iterator_proto_reduce(JSContext *ctx, JSValueConst this_val, acc = JS_DupValue(ctx, argv[1]); idx = 0; } else { - acc = JS_IteratorNext(ctx, this_val, method, 0, NULL, &done); + acc = JS_IteratorNext(ctx, this_val, method, &done); if (JS_IsException(acc)) goto exception_no_close; if (done) { @@ -44591,7 +44590,7 @@ static JSValue js_iterator_proto_reduce(JSContext *ctx, JSValueConst this_val, idx = 1; } for (/* empty */; /*empty*/; idx++) { - item = JS_IteratorNext(ctx, this_val, method, 0, NULL, &done); + item = JS_IteratorNext(ctx, this_val, method, &done); if (JS_IsException(item)) goto exception_no_close; if (done) @@ -44640,7 +44639,7 @@ static JSValue js_iterator_proto_toArray(JSContext *ctx, JSValueConst this_val, if (JS_IsException(result)) goto exception; for (idx = 0; /*empty*/; idx++) { - item = JS_IteratorNext(ctx, this_val, method, 0, NULL, &done); + item = JS_IteratorNext(ctx, this_val, method, &done); if (JS_IsException(item)) goto exception; if (done) @@ -44765,7 +44764,7 @@ static JSValue js_iterator_helper_next(JSContext *ctx, JSValueConst this_val, JSValue item; while (it->count > 0) { it->count--; - item = JS_IteratorNext(ctx, it->obj, it->next, 0, NULL, pdone); + item = JS_IteratorNext(ctx, it->obj, it->next, pdone); if (JS_IsException(item)) goto fail_no_close; JS_FreeValue(ctx, item); @@ -44775,7 +44774,7 @@ static JSValue js_iterator_helper_next(JSContext *ctx, JSValueConst this_val, } } - item = JS_IteratorNext(ctx, it->obj, it->next, 0, NULL, pdone); + item = JS_IteratorNext(ctx, it->obj, it->next, pdone); if (JS_IsException(item)) goto fail_no_close; ret = item; @@ -44786,7 +44785,7 @@ static JSValue js_iterator_helper_next(JSContext *ctx, JSValueConst this_val, JSValue item, selected, index_val; JSValueConst args[2]; for(;;) { - item = JS_IteratorNext(ctx, it->obj, it->next, 0, NULL, pdone); + item = JS_IteratorNext(ctx, it->obj, it->next, pdone); if (JS_IsException(item)) goto fail_no_close; if (*pdone) { @@ -44816,7 +44815,7 @@ static JSValue js_iterator_helper_next(JSContext *ctx, JSValueConst this_val, JSValueConst args[2]; for(;;) { if (JS_IsUndefined(it->inner)) { - item = JS_IteratorNext(ctx, it->obj, it->next, 0, NULL, pdone); + item = JS_IteratorNext(ctx, it->obj, it->next, pdone); if (JS_IsException(item)) goto fail_no_close; if (*pdone) { @@ -44859,7 +44858,7 @@ static JSValue js_iterator_helper_next(JSContext *ctx, JSValueConst this_val, it->inner_next = method; } - item = JS_IteratorNext(ctx, it->inner, it->inner_next, 0, NULL, pdone); + item = JS_IteratorNext(ctx, it->inner, it->inner_next, pdone); if (JS_IsException(item)) { inner_fail: JS_IteratorClose(ctx, it->inner, FALSE); @@ -44886,7 +44885,7 @@ static JSValue js_iterator_helper_next(JSContext *ctx, JSValueConst this_val, { JSValue item, index_val; JSValueConst args[2]; - item = JS_IteratorNext(ctx, it->obj, it->next, 0, NULL, pdone); + item = JS_IteratorNext(ctx, it->obj, it->next, pdone); if (JS_IsException(item)) goto fail_no_close; if (*pdone) { @@ -44908,7 +44907,7 @@ static JSValue js_iterator_helper_next(JSContext *ctx, JSValueConst this_val, JSValue item; if (it->count > 0) { it->count--; - item = JS_IteratorNext(ctx, it->obj, it->next, 0, NULL, pdone); + item = JS_IteratorNext(ctx, it->obj, it->next, pdone); if (JS_IsException(item)) goto fail_no_close; ret = item; @@ -47557,7 +47556,7 @@ static JSValue js_math_sumPrecise(JSContext *ctx, JSValueConst this_val, goto fail; sum_precise_init(s); for (;;) { - item = JS_IteratorNext(ctx, iter, next, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next, &done); if (JS_IsException(item)) goto fail; if (done) @@ -52063,7 +52062,7 @@ static JSValue js_map_constructor(JSContext *ctx, JSValueConst new_target, goto fail; for(;;) { - item = JS_IteratorNext(ctx, iter, next_method, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next_method, &done); if (JS_IsException(item)) goto fail; if (done) @@ -52625,7 +52624,7 @@ static JSValue js_object_groupBy(JSContext *ctx, JSValueConst this_val, JS_ThrowTypeError(ctx, "too many elements"); goto iterator_close_exception; } - v = JS_IteratorNext(ctx, iter, next, 0, NULL, &done); + v = JS_IteratorNext(ctx, iter, next, &done); if (JS_IsException(v)) goto exception; if (done) @@ -53032,7 +53031,7 @@ static JSValue js_set_isDisjointFrom(JSContext *ctx, JSValueConst this_val, goto exception; found = FALSE; for(;;) { - item = JS_IteratorNext(ctx, iter, next, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next, &done); if (JS_IsException(item)) goto exception; if (done) // item is JS_UNDEFINED @@ -53130,7 +53129,7 @@ static JSValue js_set_isSupersetOf(JSContext *ctx, JSValueConst this_val, goto exception; found = TRUE; for(;;) { - item = JS_IteratorNext(ctx, iter, next, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next, &done); if (JS_IsException(item)) goto exception; if (done) // item is JS_UNDEFINED @@ -53182,7 +53181,7 @@ static JSValue js_set_intersection(JSContext *ctx, JSValueConst this_val, goto exception; t = JS_GetOpaque(newset, JS_CLASS_SET); for (;;) { - item = JS_IteratorNext(ctx, iter, next, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next, &done); if (JS_IsException(item)) goto exception; if (done) // item is JS_UNDEFINED @@ -53296,7 +53295,7 @@ static JSValue js_set_difference(JSContext *ctx, JSValueConst this_val, if (JS_IsException(next)) goto exception; for (;;) { - item = JS_IteratorNext(ctx, iter, next, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next, &done); if (JS_IsException(item)) goto exception; if (done) // item is JS_UNDEFINED @@ -53347,7 +53346,7 @@ static JSValue js_set_symmetricDifference(JSContext *ctx, JSValueConst this_val, goto exception; t = JS_GetOpaque(newset, JS_CLASS_SET); for (;;) { - item = JS_IteratorNext(ctx, iter, next, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next, &done); if (JS_IsException(item)) goto exception; if (done) // item is JS_UNDEFINED @@ -53415,7 +53414,7 @@ static JSValue js_set_union(JSContext *ctx, JSValueConst this_val, goto exception; for (;;) { - item = JS_IteratorNext(ctx, iter, next, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next, &done); if (JS_IsException(item)) goto exception; if (done) // item is JS_UNDEFINED @@ -54262,7 +54261,7 @@ static JSValue js_promise_all(JSContext *ctx, JSValueConst this_val, for(;;) { /* XXX: conformance: should close the iterator if error on 'done' access, but not on 'value' access */ - item = JS_IteratorNext(ctx, iter, next_method, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next_method, &done); if (JS_IsException(item)) goto fail_reject; if (done) @@ -54392,7 +54391,7 @@ static JSValue js_promise_race(JSContext *ctx, JSValueConst this_val, for(;;) { /* XXX: conformance: should close the iterator if error on 'done' access, but not on 'value' access */ - item = JS_IteratorNext(ctx, iter, next_method, 0, NULL, &done); + item = JS_IteratorNext(ctx, iter, next_method, &done); if (JS_IsException(item)) goto fail_reject; if (done) @@ -60143,7 +60142,7 @@ static JSValue js_array_from_iterator(JSContext *ctx, uint32_t *plen, goto fail; k = 0; for(;;) { - val = JS_IteratorNext(ctx, iter, next_method, 0, NULL, &done); + val = JS_IteratorNext(ctx, iter, next_method, &done); if (JS_IsException(val)) goto fail; if (done)