Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -15484,9 +15484,13 @@ static JSValue JS_IteratorNext(JSContext *ctx, JSValueConst enum_obj,
obj = JS_IteratorNext2(ctx, enum_obj, method, argc, argv, &done);
if (JS_IsException(obj))
goto fail;
if (done != 2) {
*pdone = done;
if (likely(done == 0)) {
*pdone = false;
return obj;
} else if (done != 2) {
JS_FreeValue(ctx, obj);
*pdone = true;
return JS_UNDEFINED;
} else {
done_val = JS_GetProperty(ctx, obj, JS_ATOM_done);
if (JS_IsException(done_val))
Expand Down Expand Up @@ -38616,10 +38620,8 @@ static JSValue js_object_fromEntries(JSContext *ctx, JSValueConst this_val,
item = JS_IteratorNext(ctx, iter, next_method, 0, NULL, &done);
if (JS_IsException(item))
goto fail;
if (done) {
JS_FreeValue(ctx, item);
if (done)
break;
}

key = JS_UNDEFINED;
value = JS_UNDEFINED;
Expand Down Expand Up @@ -48506,10 +48508,8 @@ static JSValue js_map_constructor(JSContext *ctx, JSValueConst new_target,
item = JS_IteratorNext(ctx, iter, next_method, 0, NULL, &done);
if (JS_IsException(item))
goto fail;
if (done) {
JS_FreeValue(ctx, item);
if (done)
break;
}
if (is_set) {
ret = JS_Call(ctx, adder, obj, 1, vc(&item));
if (JS_IsException(ret)) {
Expand Down Expand Up @@ -55677,10 +55677,8 @@ static JSValue js_array_from_iterator(JSContext *ctx, uint32_t *plen,
val = JS_IteratorNext(ctx, iter, next_method, 0, NULL, &done);
if (JS_IsException(val))
goto fail;
if (done) {
JS_FreeValue(ctx, val);
if (done)
break;
}
if (JS_CreateDataPropertyUint32(ctx, arr, k, val, JS_PROP_THROW) < 0)
goto fail;
k++;
Expand Down
3 changes: 3 additions & 0 deletions tests/bug999.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function* f(r){ return r } // must return r
[...f({})]