diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2022-12-12 15:33:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-12 15:33:30 +0100 |
commit | 4a17c930882c5765e5fdedb50b6493469f61e32d (patch) | |
tree | 91f7157b871ee5d2414018586fc1e3a335963d53 /runtime/inspector_server.rs | |
parent | a2db70a8d0820722695e9094c8dbc888bde1ffa3 (diff) |
feat: add `--inspect-wait` flag (#17001)
This commit adds new "--inspect-wait" flag which works similarly
to "--inspect-brk" in that it waits for inspector session to be
established before running code. However it doesn't break on the first
statement of user code, but instead runs it as soon as a session
is established.
Diffstat (limited to 'runtime/inspector_server.rs')
-rw-r--r-- | runtime/inspector_server.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/inspector_server.rs b/runtime/inspector_server.rs index f29eec2e2..0423bbdce 100644 --- a/runtime/inspector_server.rs +++ b/runtime/inspector_server.rs @@ -67,7 +67,7 @@ impl InspectorServer { &self, module_url: String, js_runtime: &mut JsRuntime, - should_break_on_first_statement: bool, + wait_for_session: bool, ) { let inspector_rc = js_runtime.inspector(); let mut inspector = inspector_rc.borrow_mut(); @@ -78,7 +78,7 @@ impl InspectorServer { session_sender, deregister_rx, module_url, - should_break_on_first_statement, + wait_for_session, ); self.register_inspector_tx.unbounded_send(info).unwrap(); } @@ -233,7 +233,7 @@ async fn server( info.get_websocket_debugger_url() ); eprintln!("Visit chrome://inspect to connect to the debugger."); - if info.should_break_on_first_statement { + if info.wait_for_session { eprintln!("Deno is waiting for debugger to connect."); } if inspector_map.borrow_mut().insert(info.uuid, info).is_some() { @@ -370,7 +370,7 @@ pub struct InspectorInfo { pub new_session_tx: UnboundedSender<InspectorSessionProxy>, pub deregister_rx: oneshot::Receiver<()>, pub url: String, - pub should_break_on_first_statement: bool, + pub wait_for_session: bool, } impl InspectorInfo { @@ -379,7 +379,7 @@ impl InspectorInfo { new_session_tx: mpsc::UnboundedSender<InspectorSessionProxy>, deregister_rx: oneshot::Receiver<()>, url: String, - should_break_on_first_statement: bool, + wait_for_session: bool, ) -> Self { Self { host, @@ -388,7 +388,7 @@ impl InspectorInfo { new_session_tx, deregister_rx, url, - should_break_on_first_statement, + wait_for_session, } } |