fixed js_std_await() so that it behaves the same way as js_std_loop() (#402)

This commit is contained in:
Fabrice Bellard 2025-04-28 16:28:01 +02:00
parent 19abf1888d
commit 894ce9de1c

View File

@ -4109,8 +4109,10 @@ JSValue js_std_await(JSContext *ctx, JSValue obj)
if (err < 0) { if (err < 0) {
js_std_dump_error(ctx1); js_std_dump_error(ctx1);
} }
if (err == 0) {
if (os_poll_func) if (os_poll_func)
os_poll_func(ctx); os_poll_func(ctx);
}
} else { } else {
/* not a promise */ /* not a promise */
ret = obj; ret = obj;