added js_std_await() and use it to wait for the evaluation of a module (github issue #219)

This commit is contained in:
Fabrice Bellard
2024-01-19 10:19:58 +01:00
parent d6c7d169de
commit 84058766e9
3 changed files with 47 additions and 7 deletions

1
qjs.c
View File

@@ -64,6 +64,7 @@ static int eval_buf(JSContext *ctx, const void *buf, int buf_len,
js_module_set_import_meta(ctx, val, TRUE, TRUE);
val = JS_EvalFunction(ctx, val);
}
val = js_std_await(ctx, val);
} else {
val = JS_Eval(ctx, buf, buf_len, filename, eval_flags);
}