summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-05-05 19:46:02 +0530
committerGitHub <noreply@github.com>2024-05-05 16:16:02 +0200
commitb2628e4a069ed9fc13f34f6e4fd75f29c657e5a9 (patch)
tree2e55850b36eeca1169ad87c00ffcb7b0b2477924 /cli
parentd527b635753566e7d01391d675bf010c4856eff9 (diff)
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
Diffstat (limited to 'cli')
-rw-r--r--cli/factory.rs1
-rw-r--r--cli/standalone/mod.rs1
-rw-r--r--cli/worker.rs3
3 files changed, 5 insertions, 0 deletions
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<Url>,
pub argv0: Option<String>,
+ pub node_debug: Option<String>,
pub origin_data_folder_path: Option<PathBuf>,
pub seed: Option<u64>,
pub unsafely_ignore_certificate_errors: Option<Vec<String>>,
@@ -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,