mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 23:34:47 -05:00
fix(repl): close calls sometimes prints results (#8558)
This commit is contained in:
parent
53fa45eb73
commit
5560a6d589
1 changed files with 7 additions and 1 deletions
|
@ -449,7 +449,7 @@ pub async fn run(
|
||||||
|
|
||||||
inject_prelude(&mut worker, &mut session, context_id).await?;
|
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(
|
let line = read_line_and_poll(
|
||||||
&mut worker,
|
&mut worker,
|
||||||
&mut session,
|
&mut session,
|
||||||
|
@ -504,6 +504,12 @@ pub async fn run(
|
||||||
evaluate_response
|
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_result = evaluate_response.get("result").unwrap();
|
||||||
let evaluate_exception_details =
|
let evaluate_exception_details =
|
||||||
evaluate_response.get("exceptionDetails");
|
evaluate_response.get("exceptionDetails");
|
||||||
|
|
Loading…
Reference in a new issue