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) {
js_std_dump_error(ctx1);
}
if (os_poll_func)
os_poll_func(ctx);
if (err == 0) {
if (os_poll_func)
os_poll_func(ctx);
}
} else {
/* not a promise */
ret = obj;