Skip to content

Commit

Permalink
child-process: undo unrelated style changes
Browse files Browse the repository at this point in the history
Auto-formatting cause unnecessary indentations.
These style changes are removed.
  • Loading branch information
tkamenoko committed Jul 24, 2018
1 parent 1994e4c commit 511b977
Showing 1 changed file with 29 additions and 38 deletions.
67 changes: 29 additions & 38 deletions lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,9 @@ function normalizeExecArgs(command, options, callback) {

exports.exec = function exec(command /* , options, callback */) {
var opts = normalizeExecArgs.apply(null, arguments);
return exports.execFile(
opts.file,
opts.options,
opts.callback);
return exports.execFile(opts.file,
opts.options,
opts.callback);
};

const customPromiseExecFunction = (orig) => {
Expand Down Expand Up @@ -382,7 +381,7 @@ const _deprecatedCustomFds = deprecate(
return fd === -1 ? 'pipe' : fd;
});
}, 'child_process: options.customFds option is deprecated. ' +
'Use options.stdio instead.', 'DEP0006');
'Use options.stdio instead.', 'DEP0006');

function _convertCustomFds(options) {
if (options.customFds && !options.stdio) {
Expand All @@ -400,7 +399,7 @@ function normalizeSpawnArguments(file, args, options) {
if (Array.isArray(args)) {
args = args.slice(0);
} else if (args !== undefined &&
(args === null || typeof args !== 'object')) {
(args === null || typeof args !== 'object')) {
throw new ERR_INVALID_ARG_TYPE('args', 'object', args);
} else {
options = args;
Expand All @@ -414,16 +413,15 @@ function normalizeSpawnArguments(file, args, options) {

// Validate the cwd, if present.
if (options.cwd != null &&
typeof options.cwd !== 'string') {
typeof options.cwd !== 'string') {
throw new ERR_INVALID_ARG_TYPE('options.cwd', 'string', options.cwd);
}

// Validate detached, if present.
if (options.detached != null &&
typeof options.detached !== 'boolean') {
throw new ERR_INVALID_ARG_TYPE(
'options.detached',
'boolean', options.detached);
typeof options.detached !== 'boolean') {
throw new ERR_INVALID_ARG_TYPE('options.detached',
'boolean', options.detached);
}

// Validate the uid, if present.
Expand All @@ -438,35 +436,31 @@ function normalizeSpawnArguments(file, args, options) {

// Validate the shell, if present.
if (options.shell != null &&
typeof options.shell !== 'boolean' &&
typeof options.shell !== 'string') {
throw new ERR_INVALID_ARG_TYPE(
'options.shell',
['boolean', 'string'], options.shell);
typeof options.shell !== 'boolean' &&
typeof options.shell !== 'string') {
throw new ERR_INVALID_ARG_TYPE('options.shell',
['boolean', 'string'], options.shell);
}

// Validate argv0, if present.
if (options.argv0 != null &&
typeof options.argv0 !== 'string') {
typeof options.argv0 !== 'string') {
throw new ERR_INVALID_ARG_TYPE('options.argv0', 'string', options.argv0);
}

// Validate windowsHide, if present.
if (options.windowsHide != null &&
typeof options.windowsHide !== 'boolean') {
throw new ERR_INVALID_ARG_TYPE(
'options.windowsHide',
'boolean',
options.windowsHide);
throw new ERR_INVALID_ARG_TYPE('options.windowsHide',
'boolean', options.windowsHide);
}

// Validate windowsVerbatimArguments, if present.
if (options.windowsVerbatimArguments != null &&
typeof options.windowsVerbatimArguments !== 'boolean') {
throw new ERR_INVALID_ARG_TYPE(
'options.windowsVerbatimArguments',
'boolean',
options.windowsVerbatimArguments);
typeof options.windowsVerbatimArguments !== 'boolean') {
throw new ERR_INVALID_ARG_TYPE('options.windowsVerbatimArguments',
'boolean',
options.windowsVerbatimArguments);
}

// Make a shallow copy so we don't clobber the user's options object.
Expand Down Expand Up @@ -588,10 +582,9 @@ function spawnSync(/* file, args, options */) {
} else if (typeof input === 'string') {
pipe.input = Buffer.from(input, options.encoding);
} else {
throw new ERR_INVALID_ARG_TYPE(
`options.stdio[${i}]`,
['Buffer', 'Uint8Array', 'string'],
input);
throw new ERR_INVALID_ARG_TYPE(`options.stdio[${i}]`,
['Buffer', 'Uint8Array', 'string'],
input);
}
}
}
Expand Down Expand Up @@ -667,10 +660,9 @@ function validateTimeout(timeout) {

function validateMaxBuffer(maxBuffer) {
if (maxBuffer != null && !(typeof maxBuffer === 'number' && maxBuffer >= 0)) {
throw new ERR_OUT_OF_RANGE(
'options.maxBuffer',
'a positive number',
maxBuffer);
throw new ERR_OUT_OF_RANGE('options.maxBuffer',
'a positive number',
maxBuffer);
}
}

Expand All @@ -679,9 +671,8 @@ function sanitizeKillSignal(killSignal) {
if (typeof killSignal === 'string' || typeof killSignal === 'number') {
return convertToValidSignal(killSignal);
} else if (killSignal != null) {
throw new ERR_INVALID_ARG_TYPE(
'options.killSignal',
['string', 'number'],
killSignal);
throw new ERR_INVALID_ARG_TYPE('options.killSignal',
['string', 'number'],
killSignal);
}
}

0 comments on commit 511b977

Please sign in to comment.