diff --git a/lib/child_process.js b/lib/child_process.js index 6b077e5178e37a..00e231ef8f6f2d 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -450,7 +450,7 @@ function normalizeSpawnArguments(file, args, options) { // Validate windowsHide, if present. if (options.windowsHide != null && - typeof options.windowsHide !== 'boolean') { + typeof options.windowsHide !== 'boolean') { throw new ERR_INVALID_ARG_TYPE('options.windowsHide', 'boolean', options.windowsHide); } diff --git a/test/parallel/test-child-process-spawnsync-shell.js b/test/parallel/test-child-process-spawnsync-shell.js index 637cb12a2332bd..a4118168183250 100644 --- a/test/parallel/test-child-process-spawnsync-shell.js +++ b/test/parallel/test-child-process-spawnsync-shell.js @@ -54,11 +54,13 @@ assert.strictEqual(env.stdout.toString().trim(), 'buzz'); function test(testPlatform, shell, shellOutput) { platform = testPlatform; - + const isCmd = shellOutput.endsWith('cmd.exe') || + shellOutput.endsWith('cmd'); const cmd = 'not_a_real_command'; - const shellFlags = platform === 'win32' ? ['/d', '/s', '/c'] : ['-c']; - const outputCmd = platform === 'win32' ? `"${cmd}"` : cmd; - const windowsVerbatim = platform === 'win32' ? true : undefined; + + const shellFlags = isCmd ? ['/d', '/s', '/c'] : ['-c']; + const outputCmd = isCmd ? `"${cmd}"` : cmd; + const windowsVerbatim = isCmd ? true : undefined; internalCp.spawnSync = common.mustCall(function(opts) { assert.strictEqual(opts.file, shellOutput); assert.deepStrictEqual(opts.args,