Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 208bc81

Browse filesBrowse files
hotpineapplerichardlau
authored andcommitted
child_process: remove unsafe array iteration
PR-URL: #59347 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent a2d2003 commit 208bc81
Copy full SHA for 208bc81

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Collapse file

‎lib/child_process.js‎

Copy file name to clipboardExpand all lines: lib/child_process.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,8 @@ function normalizeSpawnArguments(file, args, options) {
639639

640640
if (options.shell) {
641641
validateArgumentNullCheck(options.shell, 'options.shell');
642-
const command = ArrayPrototypeJoin([file, ...args], ' ');
642+
643+
const command = args.length > 0 ? `${file} ${ArrayPrototypeJoin(args, ' ')}` : file;
643644
// Set the shell, switches, and commands.
644645
if (process.platform === 'win32') {
645646
if (typeof options.shell === 'string')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.