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 --- ext/node/polyfills/02_init.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'ext/node') 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, -- cgit v1.2.3