summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/process.ts
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2024-02-23 22:00:29 +0530
committerGitHub <noreply@github.com>2024-02-23 17:30:29 +0100
commit47dee65e4ad20847108d2f7e590c001ca9b93204 (patch)
treec6c02343e50486ec4c7f7ddd5ee6ce2ad6249865 /ext/node/polyfills/process.ts
parentcddefecfff38215cef509aa6c0a2119682b49c15 (diff)
fix(ext/node): set correct process.argv0 (#22555)
Diffstat (limited to 'ext/node/polyfills/process.ts')
-rw-r--r--ext/node/polyfills/process.ts15
1 files changed, 3 insertions, 12 deletions
diff --git a/ext/node/polyfills/process.ts b/ext/node/polyfills/process.ts
index 518718470..c6dfe6c62 100644
--- a/ext/node/polyfills/process.ts
+++ b/ext/node/polyfills/process.ts
@@ -45,8 +45,7 @@ import { isWindows } from "ext:deno_node/_util/os.ts";
import * as io from "ext:deno_io/12_io.js";
import { Command } from "ext:runtime/40_process.js";
-let argv0Getter = () => "";
-export let argv0 = "deno";
+export let argv0 = "";
export let arch = "";
@@ -389,9 +388,6 @@ class Process extends EventEmitter {
argv = argv;
get argv0() {
- if (!argv0) {
- argv0 = argv0Getter();
- }
return argv0;
}
@@ -875,19 +871,14 @@ internals.__bootstrapNodeProcess = function (
) {
// Overwrites the 1st item with getter.
if (typeof argv0Val === "string") {
+ argv0 = argv0Val;
Object.defineProperty(argv, "0", {
get: () => {
return argv0Val;
},
});
- argv0Getter = () => argv0Val;
} else {
- Object.defineProperty(argv, "0", {
- get: () => {
- return Deno.execPath();
- },
- });
- argv0Getter = () => Deno.execPath();
+ Object.defineProperty(argv, "0", { get: () => argv0 });
}
// Overwrites the 2st item with getter.