Skip to content

Commit 81592ff

Browse files
aduh95targos
authored andcommitted
child_process: add trailing commas in source files
PR-URL: #46758 Reviewed-By: Deokjin Kim <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 4f2bf8c commit 81592ff

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
@@ -267,11 +267,13 @@ overrides:
267267
- ./_stream_*.js
268268
- ./_tls_common.js
269269
- ./assert/*.js
270+
- ./child_process.js
270271
- ./cluster.js
271272
- ./console.js
272273
- ./constants.js
273274
- ./fs.js
274275
- ./internal/assert.js
276+
- ./internal/child_process.js
275277
- ./internal/child_process/*.js
276278
- ./internal/cli_table.js
277279
- ./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');
@@ -70,7 +70,7 @@ const {
7070
UV_ENFILE,
7171
UV_ENOENT,
7272
UV_ENOSYS,
73-
UV_ESRCH
73+
UV_ESRCH,
7474
} = internalBinding('uv');
7575

7676
const { SocketListSend, SocketListReceive } = SocketList;
@@ -97,7 +97,7 @@ const handleConversion = {
9797

9898
got(message, handle, emit) {
9999
emit(handle);
100-
}
100+
},
101101
},
102102

103103
'net.Server': {
@@ -112,7 +112,7 @@ const handleConversion = {
112112
server.listen(handle, () => {
113113
emit(server);
114114
});
115-
}
115+
},
116116
},
117117

118118
'net.Socket': {
@@ -186,7 +186,7 @@ const handleConversion = {
186186
const socket = new net.Socket({
187187
handle: handle,
188188
readable: true,
189-
writable: true
189+
writable: true,
190190
});
191191

192192
// If the socket was created by net.Server we will track the socket
@@ -195,12 +195,12 @@ const handleConversion = {
195195
// Add socket to connections list
196196
const socketList = getSocketList('got', this, message.key);
197197
socketList.add({
198-
socket: socket
198+
socket: socket,
199199
});
200200
}
201201

202202
emit(socket);
203-
}
203+
},
204204
},
205205

206206
'dgram.Native': {
@@ -212,7 +212,7 @@ const handleConversion = {
212212

213213
got(message, handle, emit) {
214214
emit(handle);
215-
}
215+
},
216216
},
217217

218218
'dgram.Socket': {
@@ -230,8 +230,8 @@ const handleConversion = {
230230
socket.bind(handle, () => {
231231
emit(socket);
232232
});
233-
}
234-
}
233+
},
234+
},
235235
};
236236

237237
function stdioStringToArray(stdio, channel) {
@@ -587,7 +587,7 @@ function setupChannel(target, channel, serializationMode) {
587587
target.channel = val;
588588
}, channelDeprecationMsg, 'DEP0129'),
589589
configurable: true,
590-
enumerable: false
590+
enumerable: false,
591591
});
592592

593593
target._handleQueue = null;
@@ -598,7 +598,7 @@ function setupChannel(target, channel, serializationMode) {
598598
const {
599599
initMessageChannel,
600600
parseChannelMessages,
601-
writeChannelMessage
601+
writeChannelMessage,
602602
} = serialization[serializationMode];
603603

604604
let pendingHandle = null;
@@ -784,7 +784,7 @@ function setupChannel(target, channel, serializationMode) {
784784
message = {
785785
cmd: 'NODE_HANDLE',
786786
type: null,
787-
msg: message
787+
msg: message,
788788
};
789789

790790
if (handle instanceof net.Socket) {
@@ -1015,7 +1015,7 @@ function getValidStdio(stdio, sync) {
10151015
const a = {
10161016
type: stdio === 'overlapped' ? 'overlapped' : 'pipe',
10171017
readable: i === 0,
1018-
writable: i !== 0
1018+
writable: i !== 0,
10191019
};
10201020

10211021
if (!sync)
@@ -1038,17 +1038,17 @@ function getValidStdio(stdio, sync) {
10381038
ArrayPrototypePush(acc, {
10391039
type: 'pipe',
10401040
handle: ipc,
1041-
ipc: true
1041+
ipc: true,
10421042
});
10431043
} else if (stdio === 'inherit') {
10441044
ArrayPrototypePush(acc, {
10451045
type: 'inherit',
1046-
fd: i
1046+
fd: i,
10471047
});
10481048
} else if (typeof stdio === 'number' || typeof stdio.fd === 'number') {
10491049
ArrayPrototypePush(acc, {
10501050
type: 'fd',
1051-
fd: typeof stdio === 'number' ? stdio : stdio.fd
1051+
fd: typeof stdio === 'number' ? stdio : stdio.fd,
10521052
});
10531053
} else if (getHandleWrapType(stdio) || getHandleWrapType(stdio.handle) ||
10541054
getHandleWrapType(stdio._handle)) {
@@ -1060,7 +1060,7 @@ function getValidStdio(stdio, sync) {
10601060
type: 'wrap',
10611061
wrapType: getHandleWrapType(handle),
10621062
handle: handle,
1063-
_stdio: stdio
1063+
_stdio: stdio,
10641064
});
10651065
} else if (isArrayBufferView(stdio) || typeof stdio === 'string') {
10661066
if (!sync) {
@@ -1128,5 +1128,5 @@ module.exports = {
11281128
setupChannel,
11291129
getValidStdio,
11301130
stdioStringToArray,
1131-
spawnSync
1131+
spawnSync,
11321132
};

0 commit comments

Comments
 (0)