]> git.kaiwu.me - quickjs.git/commitdiff
fixed js_std_await() in case 'obj' is not a promise (github issue #222)
authorFabrice Bellard <fabrice@bellard.org>
Mon, 22 Jan 2024 17:03:35 +0000 (18:03 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Mon, 22 Jan 2024 17:03:35 +0000 (18:03 +0100)
quickjs-libc.c

index 67fe2f690e7c0e5114be31561bd06804aed03ddf..6d50a903032405c7b029edf119fae9d0bd928e92 100644 (file)
@@ -3974,6 +3974,7 @@ JSValue js_std_await(JSContext *ctx, JSValue obj)
         } else {
             /* not a promise */
             ret = obj;
+            break;
         }
     }
     return ret;