summaryrefslogtreecommitdiff
path: root/repl.js
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2025-03-27 15:34:20 +0100
committerFabrice Bellard <fabrice@bellard.org>2025-03-27 15:34:20 +0100
commitd045a13b4be31f490c972887ae7464aabcad991a (patch)
treeaac803e3a51d72d5927013f591657fd2f19e8222 /repl.js
parente8cfe8fede99abe00bf677cc3c9c1a9de273a125 (diff)
downloadquickjs-d045a13b4be31f490c972887ae7464aabcad991a.tar.gz
quickjs-d045a13b4be31f490c972887ae7464aabcad991a.zip
disable rejection tracker in the repl - repl cleanup
Diffstat (limited to 'repl.js')
-rw-r--r--repl.js14
1 files changed, 5 insertions, 9 deletions
diff --git a/repl.js b/repl.js
index e6e720b..3f8393a 100644
--- a/repl.js
+++ b/repl.js
@@ -1098,24 +1098,20 @@ import * as os from "os";
}
mexpr = "";
- eval_and_print_start(expr, true);
+ eval_and_print_start(expr);
return true;
}
- function eval_and_print_start(expr, is_async) {
+ function eval_and_print_start(expr) {
var result;
try {
eval_start_time = os.now();
/* eval as a script */
- result = std.evalScript(expr, { backtrace_barrier: true, async: is_async });
- if (is_async) {
- /* result is a promise */
- result.then(print_eval_result, print_eval_error);
- } else {
- print_eval_result({ value: result });
- }
+ result = std.evalScript(expr, { backtrace_barrier: true, async: true });
+ /* result is a promise */
+ result.then(print_eval_result, print_eval_error);
} catch (error) {
print_eval_error(error);
}