diff options
author | cjihrig <cjihrig@gmail.com> | 2019-05-24 11:00:45 -0400 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2019-05-27 14:10:51 -0400 |
commit | 4f9cd2770a5f04b4e83157c71a3a9f1bf5b42d84 (patch) | |
tree | 2032a71c650abe5dc84ac38014b9d130f6da296b /lib/internal/child_process.js | |
parent | 476c3ec750fe2809721d352598fbc02620da829b (diff) | |
download | android-node-v8-4f9cd2770a5f04b4e83157c71a3a9f1bf5b42d84.tar.gz android-node-v8-4f9cd2770a5f04b4e83157c71a3a9f1bf5b42d84.tar.bz2 android-node-v8-4f9cd2770a5f04b4e83157c71a3a9f1bf5b42d84.zip |
child_process: simplify spawn argument parsing
This commit simplifies the object returned by
normalizeSpawnArguments(). This does impact monkey patching,
as illustrated by the changes in tests.
PR-URL: https://github.com/nodejs/node/pull/27854
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'lib/internal/child_process.js')
-rw-r--r-- | lib/internal/child_process.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index a0f083d8de..71eeed2994 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -1022,8 +1022,7 @@ function maybeClose(subprocess) { } } -function spawnSync(opts) { - const options = opts.options; +function spawnSync(options) { const result = spawn_sync.spawn(options); if (result.output && options.encoding && options.encoding !== 'buffer') { @@ -1038,9 +1037,9 @@ function spawnSync(opts) { result.stderr = result.output && result.output[2]; if (result.error) { - result.error = errnoException(result.error, 'spawnSync ' + opts.file); - result.error.path = opts.file; - result.error.spawnargs = opts.args.slice(1); + result.error = errnoException(result.error, 'spawnSync ' + options.file); + result.error.path = options.file; + result.error.spawnargs = options.args.slice(1); } return result; |