From b2628e4a069ed9fc13f34f6e4fd75f29c657e5a9 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Sun, 5 May 2024 19:46:02 +0530 Subject: fix(ext/node): don't rely on Deno.env to read NODE_DEBUG (#23694) This patch allows implementors to use ext/node without the need to implement Deno.env API. Closes https://github.com/denoland/deno/issues/23687 --- cli/factory.rs | 1 + cli/standalone/mod.rs | 1 + cli/worker.rs | 3 +++ 3 files changed, 5 insertions(+) (limited to 'cli') diff --git a/cli/factory.rs b/cli/factory.rs index bfaf96f39..a9f6bf87e 100644 --- a/cli/factory.rs +++ b/cli/factory.rs @@ -885,6 +885,7 @@ impl CliFactory { .options .take_binary_npm_command_name() .or(std::env::args().next()), + node_debug: std::env::var("NODE_DEBUG").ok(), origin_data_folder_path: Some(self.deno_dir()?.origin_data_folder_path()), seed: self.options.seed(), unsafely_ignore_certificate_errors: self diff --git a/cli/standalone/mod.rs b/cli/standalone/mod.rs index 3cfeb4f4c..47b035fc7 100644 --- a/cli/standalone/mod.rs +++ b/cli/standalone/mod.rs @@ -565,6 +565,7 @@ pub async fn run( .ok() .map(|req_ref| npm_pkg_req_ref_to_binary_command(&req_ref)) .or(std::env::args().next()), + node_debug: std::env::var("NODE_DEBUG").ok(), origin_data_folder_path: None, seed: metadata.seed, unsafely_ignore_certificate_errors: metadata diff --git a/cli/worker.rs b/cli/worker.rs index edc4ef907..302c00e10 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -112,6 +112,7 @@ pub struct CliMainWorkerOptions { pub is_npm_main: bool, pub location: Option, pub argv0: Option, + pub node_debug: Option, pub origin_data_folder_path: Option, pub seed: Option, pub unsafely_ignore_certificate_errors: Option>, @@ -607,6 +608,7 @@ impl CliMainWorkerFactory { inspect: shared.options.is_inspecting, has_node_modules_dir: shared.options.has_node_modules_dir, argv0: shared.options.argv0.clone(), + node_debug: shared.options.node_debug.clone(), node_ipc_fd: shared.node_ipc, disable_deprecated_api_warning: shared.disable_deprecated_api_warning, verbose_deprecated_api_warning: shared.verbose_deprecated_api_warning, @@ -816,6 +818,7 @@ fn create_web_worker_callback( inspect: shared.options.is_inspecting, has_node_modules_dir: shared.options.has_node_modules_dir, argv0: shared.options.argv0.clone(), + node_debug: shared.options.node_debug.clone(), node_ipc_fd: None, disable_deprecated_api_warning: shared.disable_deprecated_api_warning, verbose_deprecated_api_warning: shared.verbose_deprecated_api_warning, -- cgit v1.2.3