diff --git a/quickjs.c b/quickjs.c index d8ef72c..1a1ba12 100644 --- a/quickjs.c +++ b/quickjs.c @@ -21105,9 +21105,8 @@ static JSValue js_async_generator_resolve_function(JSContext *ctx, } else { js_async_generator_resolve(ctx, s, arg, TRUE); } - } else { + } else if (s->state == JS_ASYNC_GENERATOR_STATE_EXECUTING) { /* restart function execution after await() */ - assert(s->state == JS_ASYNC_GENERATOR_STATE_EXECUTING); s->func_state->throw_flag = is_reject; if (is_reject) { JS_Throw(ctx, JS_DupValue(ctx, arg));