summaryrefslogtreecommitdiff
path: root/runtime/js/40_process.js
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-03-25 08:17:13 -0400
committerGitHub <noreply@github.com>2022-03-25 08:17:13 -0400
commit4691bde42935582a217ce1453d4c8a495ed4af86 (patch)
treee90ef2d3089977204d87be102a0b71cf5f62c8c3 /runtime/js/40_process.js
parent84b1acf8baf34d8651b4d0e871072b40f321737f (diff)
fix: `Deno.run` - do not modify user provided `cmd` array (#14109)
Diffstat (limited to 'runtime/js/40_process.js')
-rw-r--r--runtime/js/40_process.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/js/40_process.js b/runtime/js/40_process.js
index c33ce1c04..545c6c6d6 100644
--- a/runtime/js/40_process.js
+++ b/runtime/js/40_process.js
@@ -9,6 +9,7 @@
const { assert } = window.__bootstrap.infra;
const {
ArrayPrototypeMap,
+ ArrayPrototypeSlice,
TypeError,
isNaN,
ObjectEntries,
@@ -110,7 +111,7 @@
stdin = "inherit",
}) {
if (cmd[0] != null) {
- cmd[0] = pathFromURL(cmd[0]);
+ cmd = [pathFromURL(cmd[0]), ...ArrayPrototypeSlice(cmd, 1)];
}
const res = opRun({
cmd: ArrayPrototypeMap(cmd, String),