Skip to content

Commit

Permalink
child_process: add trailing commas in source files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
aduh95 authored and danielleadams committed Apr 5, 2023
1 parent 91fbad6 commit 5353110
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 30 deletions.
2 changes: 2 additions & 0 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,13 @@ overrides:
- ./_stream_*.js
- ./_tls_common.js
- ./assert/*.js
- ./child_process.js
- ./cluster.js
- ./console.js
- ./constants.js
- ./fs.js
- ./internal/assert.js
- ./internal/child_process.js
- ./internal/child_process/*.js
- ./internal/cli_table.js
- ./internal/cluster/*.js
Expand Down
18 changes: 9 additions & 9 deletions lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const {
getValidStdio,
setupChannel,
ChildProcess,
stdioStringToArray
stdioStringToArray,
} = child_process;

const MAX_BUFFER = 1024 * 1024;
Expand Down Expand Up @@ -200,7 +200,7 @@ function normalizeExecArgs(command, options, callback) {
return {
file: command,
options: options,
callback: callback
callback: callback,
};
}

Expand Down Expand Up @@ -255,7 +255,7 @@ const customPromiseExecFunction = (orig) => {
ObjectDefineProperty(exec, promisify.custom, {
__proto__: null,
enumerable: false,
value: customPromiseExecFunction(exec)
value: customPromiseExecFunction(exec),
});

function normalizeExecFileArgs(file, args, options, callback) {
Expand Down Expand Up @@ -334,7 +334,7 @@ function execFile(file, args, options, callback) {
cwd: null,
env: null,
shell: false,
...options
...options,
};

// Validate the timeout, if present.
Expand All @@ -353,7 +353,7 @@ function execFile(file, args, options, callback) {
signal: options.signal,
uid: options.uid,
windowsHide: !!options.windowsHide,
windowsVerbatimArguments: !!options.windowsVerbatimArguments
windowsVerbatimArguments: !!options.windowsVerbatimArguments,
});

let encoding;
Expand Down Expand Up @@ -419,7 +419,7 @@ function execFile(file, args, options, callback) {
ex = genericNodeError(`Command failed: ${cmd}\n${stderr}`, {
code: code < 0 ? getSystemErrorName(code) : code,
killed: child.killed || killed,
signal: signal
signal: signal,
});
}

Expand Down Expand Up @@ -530,7 +530,7 @@ function execFile(file, args, options, callback) {
ObjectDefineProperty(execFile, promisify.custom, {
__proto__: null,
enumerable: false,
value: customPromiseExecFunction(execFile)
value: customPromiseExecFunction(execFile),
});

function copyProcessEnvToEnv(env, name, optionEnv) {
Expand Down Expand Up @@ -827,7 +827,7 @@ function spawn(file, args, options) {
function spawnSync(file, args, options) {
options = {
maxBuffer: MAX_BUFFER,
...normalizeSpawnArguments(file, args, options)
...normalizeSpawnArguments(file, args, options),
};

debug('spawnSync', options);
Expand Down Expand Up @@ -1012,5 +1012,5 @@ module.exports = {
execSync,
fork,
spawn,
spawnSync
spawnSync,
};
42 changes: 21 additions & 21 deletions lib/internal/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const {
ERR_IPC_DISCONNECTED,
ERR_IPC_ONE_PIPE,
ERR_IPC_SYNC_FORK,
ERR_MISSING_ARGS
}
ERR_MISSING_ARGS,
},
} = require('internal/errors');
const {
validateArray,
Expand All @@ -47,7 +47,7 @@ const {
kReadBytesOrError,
kArrayBufferOffset,
kLastWriteWasAsync,
streamBaseState
streamBaseState,
} = internalBinding('stream_wrap');
const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
const { TCP } = internalBinding('tcp_wrap');
Expand All @@ -68,7 +68,7 @@ const {
UV_ENFILE,
UV_ENOENT,
UV_ENOSYS,
UV_ESRCH
UV_ESRCH,
} = internalBinding('uv');

const { SocketListSend, SocketListReceive } = SocketList;
Expand All @@ -95,7 +95,7 @@ const handleConversion = {

got(message, handle, emit) {
emit(handle);
}
},
},

'net.Server': {
Expand All @@ -110,7 +110,7 @@ const handleConversion = {
server.listen(handle, () => {
emit(server);
});
}
},
},

'net.Socket': {
Expand Down Expand Up @@ -184,7 +184,7 @@ const handleConversion = {
const socket = new net.Socket({
handle: handle,
readable: true,
writable: true
writable: true,
});

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

emit(socket);
}
},
},

'dgram.Native': {
Expand All @@ -210,7 +210,7 @@ const handleConversion = {

got(message, handle, emit) {
emit(handle);
}
},
},

'dgram.Socket': {
Expand All @@ -228,8 +228,8 @@ const handleConversion = {
socket.bind(handle, () => {
emit(socket);
});
}
}
},
},
};

function stdioStringToArray(stdio, channel) {
Expand Down Expand Up @@ -580,7 +580,7 @@ function setupChannel(target, channel, serializationMode) {
target.channel = val;
}, channelDeprecationMsg, 'DEP0129'),
configurable: true,
enumerable: false
enumerable: false,
});

target._handleQueue = null;
Expand All @@ -591,7 +591,7 @@ function setupChannel(target, channel, serializationMode) {
const {
initMessageChannel,
parseChannelMessages,
writeChannelMessage
writeChannelMessage,
} = serialization[serializationMode];

let pendingHandle = null;
Expand Down Expand Up @@ -777,7 +777,7 @@ function setupChannel(target, channel, serializationMode) {
message = {
cmd: 'NODE_HANDLE',
type: null,
msg: message
msg: message,
};

if (handle instanceof net.Socket) {
Expand Down Expand Up @@ -1008,7 +1008,7 @@ function getValidStdio(stdio, sync) {
const a = {
type: stdio === 'overlapped' ? 'overlapped' : 'pipe',
readable: i === 0,
writable: i !== 0
writable: i !== 0,
};

if (!sync)
Expand All @@ -1031,17 +1031,17 @@ function getValidStdio(stdio, sync) {
ArrayPrototypePush(acc, {
type: 'pipe',
handle: ipc,
ipc: true
ipc: true,
});
} else if (stdio === 'inherit') {
ArrayPrototypePush(acc, {
type: 'inherit',
fd: i
fd: i,
});
} else if (typeof stdio === 'number' || typeof stdio.fd === 'number') {
ArrayPrototypePush(acc, {
type: 'fd',
fd: typeof stdio === 'number' ? stdio : stdio.fd
fd: typeof stdio === 'number' ? stdio : stdio.fd,
});
} else if (getHandleWrapType(stdio) || getHandleWrapType(stdio.handle) ||
getHandleWrapType(stdio._handle)) {
Expand All @@ -1053,7 +1053,7 @@ function getValidStdio(stdio, sync) {
type: 'wrap',
wrapType: getHandleWrapType(handle),
handle: handle,
_stdio: stdio
_stdio: stdio,
});
} else if (isArrayBufferView(stdio) || typeof stdio === 'string') {
if (!sync) {
Expand Down Expand Up @@ -1121,5 +1121,5 @@ module.exports = {
setupChannel,
getValidStdio,
stdioStringToArray,
spawnSync
spawnSync,
};

0 comments on commit 5353110

Please sign in to comment.