From fb7092fb43d5a6e5a29ca5b2f0de6683ee55f3e5 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Tue, 29 Aug 2023 12:18:25 +0900 Subject: fix(ext/node): fix argv[1] in Worker (#20305) --- ext/node/polyfills/process.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts index c7c22b562..64a3ef31b 100644 --- a/ext/node/polyfills/process.ts +++ b/ext/node/polyfills/process.ts @@ -873,7 +873,7 @@ internals.__bootstrapNodeProcess = function ( // Overwrites the 2st item with getter. Object.defineProperty(argv, "1", { get: () => { - if (Deno.mainModule.startsWith("file:")) { + if (Deno.mainModule?.startsWith("file:")) { return pathFromURL(new URL(Deno.mainModule)); } else { return join(Deno.cwd(), "$deno$node.js"); -- cgit v1.2.3