summaryrefslogtreecommitdiff
path: root/repl.js
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2024-02-03 15:47:42 +0100
committerFabrice Bellard <fabrice@bellard.org>2024-02-03 15:47:42 +0100
commit00967aac2408af0d3e591918b25e700229c9cdb3 (patch)
treee4d37c175697cdf457157a0d47c26ae06370c3f9 /repl.js
parentc6cc6a9a5e420fa2707e828da23d131d2bf170f7 (diff)
downloadquickjs-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.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/repl.js b/repl.js
index 62714a9..6b96339 100644
--- a/repl.js
+++ b/repl.js
@@ -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);