summaryrefslogtreecommitdiff
path: root/ext
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 /ext
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 'ext')
-rw-r--r--ext/node/polyfills/02_init.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/ext/node/polyfills/02_init.js b/ext/node/polyfills/02_init.js
index 71eebbc81..7a697abe4 100644
--- a/ext/node/polyfills/02_init.js
+++ b/ext/node/polyfills/02_init.js
@@ -10,14 +10,16 @@ import "node:module";
let initialized = false;
-function initialize(
- usesLocalNodeModulesDir,
- argv0,
- runningOnMainThread,
- workerId,
- maybeWorkerMetadata,
- warmup = false,
-) {
+function initialize(args) {
+ const {
+ usesLocalNodeModulesDir,
+ argv0,
+ runningOnMainThread,
+ workerId,
+ maybeWorkerMetadata,
+ nodeDebug,
+ warmup = false,
+ } = args;
if (!warmup) {
if (initialized) {
throw Error("Node runtime already initialized");
@@ -33,7 +35,7 @@ function initialize(
argv0,
Deno.args,
Deno.version,
- Deno.env.get("NODE_DEBUG") ?? "",
+ nodeDebug ?? "",
);
internals.__initWorkerThreads(
runningOnMainThread,