summaryrefslogtreecommitdiff
path: root/runtime
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
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')
-rw-r--r--runtime/snapshot.rs7
-rw-r--r--runtime/web_worker.rs14
-rw-r--r--runtime/worker.rs15
3 files changed, 22 insertions, 14 deletions
diff --git a/runtime/snapshot.rs b/runtime/snapshot.rs
index 0d81af6e7..251ee5f41 100644
--- a/runtime/snapshot.rs
+++ b/runtime/snapshot.rs
@@ -82,6 +82,13 @@ impl deno_node::NodePermissions for Permissions {
) -> Result<(), PermissionCheckError> {
unreachable!("snapshotting!")
}
+ fn check_net(
+ &mut self,
+ _host: (&str, Option<u16>),
+ _api_name: &str,
+ ) -> Result<(), PermissionCheckError> {
+ unreachable!("snapshotting!")
+ }
fn check_read_path<'a>(
&mut self,
_path: &'a Path,
diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs
index 04cd3305e..61e5c7702 100644
--- a/runtime/web_worker.rs
+++ b/runtime/web_worker.rs
@@ -562,7 +562,7 @@ impl WebWorker {
extension_transpiler: Some(Rc::new(|specifier, source| {
maybe_transpile_source(specifier, source)
})),
- inspector: services.maybe_inspector_server.is_some(),
+ inspector: true,
feature_checker: Some(services.feature_checker),
op_metrics_factory_fn,
import_meta_resolve_callback: Some(Box::new(
@@ -579,18 +579,18 @@ impl WebWorker {
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) = services.maybe_inspector_server {
server.register_inspector(
options.main_module.to_string(),
&mut js_runtime,
false,
);
-
- // 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 (internal_handle, external_handle) = {
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,