From: Fabrice Bellard Date: Mon, 28 Apr 2025 14:28:01 +0000 (+0200) Subject: fixed js_std_await() so that it behaves the same way as js_std_loop() (#402) X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/stylesheets/stylesheet.css?a=commitdiff_plain;h=894ce9de1c76acb6b84385e152ff1cd6cb6626bd;p=quickjs.git fixed js_std_await() so that it behaves the same way as js_std_loop() (#402) --- diff --git a/quickjs-libc.c b/quickjs-libc.c index 0788d8c..04684b9 100644 --- a/quickjs-libc.c +++ b/quickjs-libc.c @@ -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;