Skip to content

Commit 5353110

Browse files
aduh95danielleadams
authored andcommitted
child_process: add trailing commas in source files
PR-URL: #46758 Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 91fbad6 commit 5353110

File tree

3 files changed

+32
-30
lines changed

3 files changed

+32
-30
lines changed

lib/.eslintrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,13 @@ overrides:
255255
- ./_stream_*.js
256256
- ./_tls_common.js
257257
- ./assert/*.js
258+
- ./child_process.js
258259
- ./cluster.js
259260
- ./console.js
260261
- ./constants.js
261262
- ./fs.js
262263
- ./internal/assert.js
264+
- ./internal/child_process.js
263265
- ./internal/child_process/*.js
264266
- ./internal/cli_table.js
265267
- ./internal/cluster/*.js

lib/child_process.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const {
8989
getValidStdio,
9090
setupChannel,
9191
ChildProcess,
92-
stdioStringToArray
92+
stdioStringToArray,
9393
} = child_process;
9494

9595
const MAX_BUFFER = 1024 * 1024;
@@ -200,7 +200,7 @@ function normalizeExecArgs(command, options, callback) {
200200
return {
201201
file: command,
202202
options: options,
203-
callback: callback
203+
callback: callback,
204204
};
205205
}
206206

@@ -255,7 +255,7 @@ const customPromiseExecFunction = (orig) => {
255255
ObjectDefineProperty(exec, promisify.custom, {
256256
__proto__: null,
257257
enumerable: false,
258-
value: customPromiseExecFunction(exec)
258+
value: customPromiseExecFunction(exec),
259259
});
260260

261261
function normalizeExecFileArgs(file, args, options, callback) {
@@ -334,7 +334,7 @@ function execFile(file, args, options, callback) {
334334
cwd: null,
335335
env: null,
336336
shell: false,
337-
...options
337+
...options,
338338
};
339339

340340
// Validate the timeout, if present.
@@ -353,7 +353,7 @@ function execFile(file, args, options, callback) {
353353
signal: options.signal,
354354
uid: options.uid,
355355
windowsHide: !!options.windowsHide,
356-
windowsVerbatimArguments: !!options.windowsVerbatimArguments
356+
windowsVerbatimArguments: !!options.windowsVerbatimArguments,
357357
});
358358

359359
let encoding;
@@ -419,7 +419,7 @@ function execFile(file, args, options, callback) {
419419
ex = genericNodeError(`Command failed: ${cmd}\n${stderr}`, {
420420
code: code < 0 ? getSystemErrorName(code) : code,
421421
killed: child.killed || killed,
422-
signal: signal
422+
signal: signal,
423423
});
424424
}
425425

@@ -530,7 +530,7 @@ function execFile(file, args, options, callback) {
530530
ObjectDefineProperty(execFile, promisify.custom, {
531531
__proto__: null,
532532
enumerable: false,
533-
value: customPromiseExecFunction(execFile)
533+
value: customPromiseExecFunction(execFile),
534534
});
535535

536536
function copyProcessEnvToEnv(env, name, optionEnv) {
@@ -827,7 +827,7 @@ function spawn(file, args, options) {
827827
function spawnSync(file, args, options) {
828828
options = {
829829
maxBuffer: MAX_BUFFER,
830-
...normalizeSpawnArguments(file, args, options)
830+
...normalizeSpawnArguments(file, args, options),
831831
};
832832

833833
debug('spawnSync', options);
@@ -1012,5 +1012,5 @@ module.exports = {
10121012
execSync,
10131013
fork,
10141014
spawn,
1015-
spawnSync
1015+
spawnSync,
10161016
};

lib/internal/child_process.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const {
2626
ERR_IPC_DISCONNECTED,
2727
ERR_IPC_ONE_PIPE,
2828
ERR_IPC_SYNC_FORK,
29-
ERR_MISSING_ARGS
30-
}
29+
ERR_MISSING_ARGS,
30+
},
3131
} = require('internal/errors');
3232
const {
3333
validateArray,
@@ -47,7 +47,7 @@ const {
4747
kReadBytesOrError,
4848
kArrayBufferOffset,
4949
kLastWriteWasAsync,
50-
streamBaseState
50+
streamBaseState,
5151
} = internalBinding('stream_wrap');
5252
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
5353
const { TCP } = internalBinding('tcp_wrap');
@@ -68,7 +68,7 @@ const {
6868
UV_ENFILE,
6969
UV_ENOENT,
7070
UV_ENOSYS,
71-
UV_ESRCH
71+
UV_ESRCH,
7272
} = internalBinding('uv');
7373

7474
const { SocketListSend, SocketListReceive } = SocketList;
@@ -95,7 +95,7 @@ const handleConversion = {
9595

9696
got(message, handle, emit) {
9797
emit(handle);
98-
}
98+
},
9999
},
100100

101101
'net.Server': {
@@ -110,7 +110,7 @@ const handleConversion = {
110110
server.listen(handle, () => {
111111
emit(server);
112112
});
113-
}
113+
},
114114
},
115115

116116
'net.Socket': {
@@ -184,7 +184,7 @@ const handleConversion = {
184184
const socket = new net.Socket({
185185
handle: handle,
186186
readable: true,
187-
writable: true
187+
writable: true,
188188
});
189189

190190
// If the socket was created by net.Server we will track the socket
@@ -193,12 +193,12 @@ const handleConversion = {
193193
// Add socket to connections list
194194
const socketList = getSocketList('got', this, message.key);
195195
socketList.add({
196-
socket: socket
196+
socket: socket,
197197
});
198198
}
199199

200200
emit(socket);
201-
}
201+
},
202202
},
203203

204204
'dgram.Native': {
@@ -210,7 +210,7 @@ const handleConversion = {
210210

211211
got(message, handle, emit) {
212212
emit(handle);
213-
}
213+
},
214214
},
215215

216216
'dgram.Socket': {
@@ -228,8 +228,8 @@ const handleConversion = {
228228
socket.bind(handle, () => {
229229
emit(socket);
230230
});
231-
}
232-
}
231+
},
232+
},
233233
};
234234

235235
function stdioStringToArray(stdio, channel) {
@@ -580,7 +580,7 @@ function setupChannel(target, channel, serializationMode) {
580580
target.channel = val;
581581
}, channelDeprecationMsg, 'DEP0129'),
582582
configurable: true,
583-
enumerable: false
583+
enumerable: false,
584584
});
585585

586586
target._handleQueue = null;
@@ -591,7 +591,7 @@ function setupChannel(target, channel, serializationMode) {
591591
const {
592592
initMessageChannel,
593593
parseChannelMessages,
594-
writeChannelMessage
594+
writeChannelMessage,
595595
} = serialization[serializationMode];
596596

597597
let pendingHandle = null;
@@ -777,7 +777,7 @@ function setupChannel(target, channel, serializationMode) {
777777
message = {
778778
cmd: 'NODE_HANDLE',
779779
type: null,
780-
msg: message
780+
msg: message,
781781
};
782782

783783
if (handle instanceof net.Socket) {
@@ -1008,7 +1008,7 @@ function getValidStdio(stdio, sync) {
10081008
const a = {
10091009
type: stdio === 'overlapped' ? 'overlapped' : 'pipe',
10101010
readable: i === 0,
1011-
writable: i !== 0
1011+
writable: i !== 0,
10121012
};
10131013

10141014
if (!sync)
@@ -1031,17 +1031,17 @@ function getValidStdio(stdio, sync) {
10311031
ArrayPrototypePush(acc, {
10321032
type: 'pipe',
10331033
handle: ipc,
1034-
ipc: true
1034+
ipc: true,
10351035
});
10361036
} else if (stdio === 'inherit') {
10371037
ArrayPrototypePush(acc, {
10381038
type: 'inherit',
1039-
fd: i
1039+
fd: i,
10401040
});
10411041
} else if (typeof stdio === 'number' || typeof stdio.fd === 'number') {
10421042
ArrayPrototypePush(acc, {
10431043
type: 'fd',
1044-
fd: typeof stdio === 'number' ? stdio : stdio.fd
1044+
fd: typeof stdio === 'number' ? stdio : stdio.fd,
10451045
});
10461046
} else if (getHandleWrapType(stdio) || getHandleWrapType(stdio.handle) ||
10471047
getHandleWrapType(stdio._handle)) {
@@ -1053,7 +1053,7 @@ function getValidStdio(stdio, sync) {
10531053
type: 'wrap',
10541054
wrapType: getHandleWrapType(handle),
10551055
handle: handle,
1056-
_stdio: stdio
1056+
_stdio: stdio,
10571057
});
10581058
} else if (isArrayBufferView(stdio) || typeof stdio === 'string') {
10591059
if (!sync) {
@@ -1121,5 +1121,5 @@ module.exports = {
11211121
setupChannel,
11221122
getValidStdio,
11231123
stdioStringToArray,
1124-
spawnSync
1124+
spawnSync,
11251125
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy