summaryrefslogtreecommitdiff
path: root/runtime/worker.rs
diff options
context:
space:
mode:
authorsnek <snek@deno.com>2024-11-06 15:08:26 +0100
committerGitHub <noreply@github.com>2024-11-06 14:08:26 +0000
commit700f54a13cce0fcdcf19d1893e3254579c7347f4 (patch)
tree16e72baca781c32c1304f3bed009878854ae9edc /runtime/worker.rs
parent64e887083aa67047f5ad37b9d55c418274b03ea3 (diff)
fix(ext/node): better inspector support (#26471)
implement local inspector future changes: - wire up InspectorServer to enable open/close/url - wire up connectToMainThread Fixes https://github.com/denoland/deno/issues/25004
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r--runtime/worker.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs
index b780aefc1..88a61fa93 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -488,7 +488,7 @@ impl MainWorker {
extension_transpiler: Some(Rc::new(|specifier, source| {
maybe_transpile_source(specifier, source)
})),
- inspector: options.maybe_inspector_server.is_some(),
+ inspector: true,
is_main: true,
feature_checker: Some(services.feature_checker.clone()),
op_metrics_factory_fn,
@@ -546,6 +546,12 @@ impl MainWorker {
js_runtime.op_state().borrow_mut().put(op_summary_metrics);
}
+ // Put inspector handle into the op state so we can put a breakpoint when
+ // executing a CJS entrypoint.
+ let op_state = js_runtime.op_state();
+ let inspector = js_runtime.inspector();
+ op_state.borrow_mut().put(inspector);
+
if let Some(server) = options.maybe_inspector_server.clone() {
server.register_inspector(
main_module.to_string(),
@@ -553,13 +559,8 @@ impl MainWorker {
options.should_break_on_first_statement
|| options.should_wait_for_inspector_session,
);
-
- // Put inspector handle into the op state so we can put a breakpoint when
- // executing a CJS entrypoint.
- let op_state = js_runtime.op_state();
- let inspector = js_runtime.inspector();
- op_state.borrow_mut().put(inspector);
}
+
let (
bootstrap_fn_global,
dispatch_load_event_fn_global,