diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2024-01-02 16:09:30 +0100 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2024-01-02 16:09:30 +0100 |
commit | e44b793e3817766d9045ed2a776658fcbe0f2790 (patch) | |
tree | 8aa3974ff1c0658f1f986ac0868cd72f7cd6c8f7 /quickjs.c | |
parent | 8de4538ff3761e5d0adfa317069a722941848ce1 (diff) | |
download | quickjs-e44b793e3817766d9045ed2a776658fcbe0f2790.tar.gz quickjs-e44b793e3817766d9045ed2a776658fcbe0f2790.zip |
allow 'await' in the REPL and added os.sleepAsync()
Diffstat (limited to 'quickjs.c')
-rw-r--r-- | quickjs.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -33827,7 +33827,7 @@ static __exception int js_parse_program(JSParseState *s) emit_op(s, OP_get_loc); emit_u16(s, fd->eval_ret_idx); - emit_op(s, OP_return); + emit_return(s, TRUE); } else { emit_return(s, FALSE); } @@ -33959,7 +33959,7 @@ static JSValue __JS_EvalInternal(JSContext *ctx, JSValueConst this_obj, goto fail; } fd->module = m; - if (m != NULL) { + if (m != NULL || (flags & JS_EVAL_FLAG_ASYNC)) { fd->in_function_body = TRUE; fd->func_kind = JS_FUNC_ASYNC; } |