diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2024-02-03 15:47:42 +0100 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2024-02-03 15:47:42 +0100 |
commit | 00967aac2408af0d3e591918b25e700229c9cdb3 (patch) | |
tree | e4d37c175697cdf457157a0d47c26ae06370c3f9 /repl.js | |
parent | c6cc6a9a5e420fa2707e828da23d131d2bf170f7 (diff) | |
download | quickjs-00967aac2408af0d3e591918b25e700229c9cdb3.tar.gz quickjs-00967aac2408af0d3e591918b25e700229c9cdb3.zip |
fixed Promise return in the REPL by using a wrapper object in async std.evalScript() (github issue #231)
Diffstat (limited to 'repl.js')
-rw-r--r-- | repl.js | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1310,7 +1310,7 @@ import * as os from "os"; /* result is a promise */ result.then(print_eval_result, print_eval_error); } else { - print_eval_result(result); + print_eval_result({ value: result }); } } catch (error) { print_eval_error(error); @@ -1318,6 +1318,7 @@ import * as os from "os"; } function print_eval_result(result) { + result = result.value; eval_time = os.now() - eval_start_time; std.puts(colors[styles.result]); print(result); |