summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorCasper Beyer <caspervonb@pm.me>2020-10-06 19:50:48 +0800
committerGitHub <noreply@github.com>2020-10-06 13:50:48 +0200
commit21965e8a964a98284bf41f1502cde1c78f20c925 (patch)
tree6368a852ae2460b1925b0ccb477319ab3ca5b2c4 /cli/main.rs
parent6b8aef5103e6c77cc89ae4c7da959b39b1c4af4a (diff)
refactor(cli/repl): tightly integrate event loop (#7834)
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs22
1 files changed, 1 insertions, 21 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 6bae9c2d7..8672a5681 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -63,7 +63,6 @@ use crate::file_fetcher::SourceFileFetcher;
use crate::file_fetcher::TextDocument;
use crate::fs as deno_fs;
use crate::global_state::GlobalState;
-use crate::inspector::InspectorSession;
use crate::media_type::MediaType;
use crate::permissions::Permissions;
use crate::worker::MainWorker;
@@ -432,26 +431,7 @@ async fn run_repl(flags: Flags) -> Result<(), AnyError> {
let mut worker = MainWorker::new(&global_state, main_module.clone());
(&mut *worker).await?;
- let inspector = worker
- .inspector
- .as_mut()
- .expect("Inspector is not created.");
-
- let inspector_session = InspectorSession::new(&mut **inspector);
- let repl = repl::run(&global_state, inspector_session);
-
- tokio::pin!(repl);
-
- loop {
- tokio::select! {
- result = &mut repl => {
- return result;
- }
- _ = &mut *worker => {
- tokio::time::delay_for(tokio::time::Duration::from_millis(10)).await;
- }
- }
- }
+ repl::run(&global_state, worker).await
}
async fn run_from_stdin(flags: Flags) -> Result<(), AnyError> {