summaryrefslogtreecommitdiff
path: root/cli/tools/repl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/repl.rs')
-rw-r--r--cli/tools/repl.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/cli/tools/repl.rs b/cli/tools/repl.rs
index cd2839115..c610d7e66 100644
--- a/cli/tools/repl.rs
+++ b/cli/tools/repl.rs
@@ -449,7 +449,7 @@ pub async fn run(
inject_prelude(&mut worker, &mut session, context_id).await?;
- while !is_closing(&mut worker, &mut session, context_id).await? {
+ loop {
let line = read_line_and_poll(
&mut worker,
&mut session,
@@ -504,6 +504,12 @@ pub async fn run(
evaluate_response
};
+ // We check for close and break here instead of making it a loop condition to get
+ // consistent behavior in when the user evaluates a call to close().
+ if is_closing(&mut worker, &mut session, context_id).await? {
+ break;
+ }
+
let evaluate_result = evaluate_response.get("result").unwrap();
let evaluate_exception_details =
evaluate_response.get("exceptionDetails");