MaleDong
8a41470c85
lib: remove unused exec param
...
`exec`'s parameters are now deconstructored through
`normalizeExecArgs.apply`. We don't need an exclipit parameter anymore
(and in fact it's NEVER referred in the code directly), like `spwan` or
`spwanSync`. This might be missing.
PR-URL: https://github.com/nodejs/node/pull/22274
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: George Adams <george.adams@uk.ibm.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
2018-08-15 12:54:20 -04:00
Jon Moss
e570ae79f5
lib: extract validateString validator
...
Pulls out a common argument validator to `internal/validators`
PR-URL: https://github.com/nodejs/node/pull/22101
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-08-07 10:51:27 -04:00
Ruben Bridgewater
bd1f355fc5
lib,src: replace all C++ promises with JS promises
...
C++ promises can not be properly optimized by V8. They also behave
a tiny bit different than "regular" promises.
PR-URL: https://github.com/nodejs/node/pull/20830
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2018-07-16 16:45:48 +02:00
cjihrig
420d8afe3d
child_process: change windowsHide default to true
...
This is likely the default that more Windows users are
expecting.
PR-URL: https://github.com/nodejs/node/pull/21316
Refs: https://github.com/libuv/libuv/pull/1878
Refs: https://github.com/nodejs/node/pull/21314
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-06-20 11:02:01 -04:00
killagu
7d81f5d143
child_process: fix exec set stdout.setEncoding
...
cp.exec decide to use `_stdout`(_stdout is string) or
`Buffer.concat(_stdout)`(_stdout is buffer array) by options.encoding.
but std(out|err) encoding can be changed. If encoding is changed to
not null, `_stdout` will become string, and `Buffer.concat(_stdout)`
will throw TypeError. This patch will fix it, use
options.encoding and `std(out|err)._readableState.encoding`.
PR-URL: https://github.com/nodejs/node/pull/18976
Fixes: https://github.com/nodejs/node/issues/18969
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-05-18 15:20:28 +02:00
Denis Fäcke
c493b98b0b
child_process: name anonymous functions
...
Refs: https://github.com/nodejs/node/issues/8913
PR-URL: https://github.com/nodejs/node/pull/20399
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2018-05-02 22:35:35 -07:00
Weijia Wang
254058109f
tools: add 'spaced-comment' into eslint rules
...
PR-URL: https://github.com/nodejs/node/pull/19596
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
2018-04-01 22:33:13 +08:00
Bartosz Sosnowski
9bfe55e184
child_process: better spawn error message
...
Throw ERR_INVALID_ARG_VALUE when filename passed to spawn is empty.
Fixes: https://github.com/nodejs/node/issues/19235
PR-URL: https://github.com/nodejs/node/pull/19305
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2018-03-29 11:49:21 +02:00
Michaël Zasso
6a9f049968
tools,lib: forbid native Error constructors
...
This adds a rule that forbids the use of native Error constructors in
the `lib` directory. This is to encourage use of the `internal/errors`
mechanism. The rule is disabled for errors that are not created with
the `internal/errors` module but are still assigned an error code.
PR-URL: https://github.com/nodejs/node/pull/19373
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-03-21 20:15:33 +01:00
Michaël Zasso
1e8d110e64
lib: port errors to new system
...
This is a first batch of updates that touches non-underscored modules in
lib.
PR-URL: https://github.com/nodejs/node/pull/19034
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2018-03-05 19:51:30 +01:00
Joyee Cheung
4af1bba6d0
util: implement util.getSystemErrorName()
...
Reimplement uv.errname() as internal/util.getSystemErrorName() to
avoid the memory leaks caused by unknown error codes
and avoid calling into C++ for the error names. Also
expose it as a public API for external use.
PR-URL: https://github.com/nodejs/node/pull/18186
Refs: http://docs.libuv.org/en/v1.x/errors.html#c.uv_err_name
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-01-20 08:51:47 +08:00
Anatoli Papirovski
38ee25e2e2
child_process: do not ignore proto values of env
...
This reverts this behaviour introduced in a recent PR, and updates
the test. Without this change, CitGM and other packages are broken.
PR-URL: https://github.com/nodejs/node/pull/18210
Fixes: https://github.com/nodejs/citgm/issues/536
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2018-01-18 08:04:06 -05:00
现充
85739b6c5b
child_process: ignore undef/proto values of env
...
At present, undefined values of env option will be transferred as
a "undefined" string value, and values in prototype will also be
included, which are not usual behaviors.
This commit prevents those to be transferred to the environment of
the child process.
PR-URL: https://github.com/nodejs/node/pull/15089
Fixes: https://github.com/nodejs/node/issues/15087
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2018-01-15 13:51:11 +01:00
Weijia Wang
d022cb1bdd
lib: combine similar error codes
...
There two similar error codes in lib: "ERR_VALUE_OUT_OF_RANGE"
and "ERR_OUT_OF_RANGE". This change is to reduce them into
"ERR_VALUE_OUT_OF_RANGE"
Fixes: https://github.com/nodejs/node/issues/17603
PR-URL: https://github.com/nodejs/node/pull/17648
Fixes: https://github.com/nodejs/node/issues/17603
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-12-24 14:09:29 +08:00
Jon Moss
b1e6c0d44c
errors, child_process: use internal/errors codes
...
PR-URL: https://github.com/nodejs/node/pull/14998
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
2017-11-29 18:14:27 -05:00
Andreas Madsen
b44efded84
async_wrap: add provider types for net server
...
Adds `TCPSERVERWRAP` and `PIPESERVERWRAP` as provider types. This
makes it possible to distinguish servers from connections.
PR-URL: https://github.com/nodejs/node/pull/17157
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-11-28 02:50:54 +01:00
Chandrakala
79f805cce1
lib: replace string concatenation with template
...
PR-URL: https://github.com/nodejs/node/pull/16920
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
2017-11-11 11:04:00 +01:00
Michaël Zasso
556ebab30e
child_process: restore exec{File}Sync error props
...
In PR [1], a bunch of properties were removed from the error thrown by
execSync and execFileSync. It turns out that some of those were still
supposed to be there, as the documentation states that the error
contains the entire result from the spawnSync call.
[1] https://github.com/nodejs/node/pull/13601
PR-URL: https://github.com/nodejs/node/pull/16060
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-10-23 14:09:11 +02:00
Anatoli Papirovski
3c0ebf5aca
tools: enable additional eslint rules
...
Enable additional rules that node either already adheres to
or it makes sense to do so going forward: for-direction,
accessor-pairs, no-lonely-if and symbol-description.
Fix all instances of no-lonely-if in lib & test and disable
accessor-pairs in test-util-inspect.
PR-URL: https://github.com/nodejs/node/pull/16243
Refs: https://eslint.org/docs/rules/for-direction
Refs: https://eslint.org/docs/rules/accessor-pairs
Refs: https://eslint.org/docs/rules/no-lonely-if
Refs: https://eslint.org/docs/rules/symbol-description
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-10-19 13:54:14 -04:00
Weijia Wang
212de3c5ec
lib: use destructuring for some constants
...
This change is to unify the declaration for constants into using
destructuring on the top-level-module scope, reducing some redundant
code.
PR-URL: https://github.com/nodejs/node/pull/16063
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
2017-10-16 23:34:32 +02:00
cjihrig
3b7a9a2589
child_process: add windowsHide option
...
This commit exposes the UV_PROCESS_WINDOWS_HIDE flag in Node
as a windowsHide option to the child_process methods. The
option is only applicable to Windows, and is ignored elsewhere.
Fixes: https://github.com/nodejs/node/issues/15217
PR-URL: https://github.com/nodejs/node/pull/15380
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-10-16 16:19:54 -04:00
Timothy Gu
7907534a8d
lib: faster type checks for some types
...
PR-URL: https://github.com/nodejs/node/pull/15663
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-10-01 23:58:59 -03:00
Alex Gresnel
ed2f347f27
child_process: set shell to false in fork()
...
This commit ensures that spawn()'s shell option is unconditionally
set to false when fork() is called.
Refs: https://github.com/nodejs/node/pull/15299
Fixes: https://github.com/nodejs/node/issues/13983
PR-URL: https://github.com/nodejs/node/pull/15352
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-09-13 21:03:39 -04:00
James M Snell
58831b2f24
uv: improvements to process.binding('uv')
...
* ensure that UV_... props are constants
* improve error message ... the error message when passing
in `err >= 0` to `util._errnoException()` was less than
useful.
* refine uses of process.binding('uv')
PR-URL: https://github.com/nodejs/node/pull/14933
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-08-23 10:51:15 -07:00
Rich Trott
50f45fffc1
lib: modify destructuring for indentation
...
ESLint 4.3.0 flags an extra indentation issue that affects two of our
destructuring assignments in `lib`. This is a whitespace-only update to
comply prior to updating.
PR-URL: https://github.com/nodejs/node/pull/14417
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-07-25 12:21:26 -07:00
Rich Trott
6d090e1094
child_process: refactor normalizeSpawnArguments()
...
Code is not in hot path. Refactor ternary to be more readable if/else
block that mirrors analogous code elsewhere in the function. Change
string concatenation to template literal.
PR-URL: https://github.com/nodejs/node/pull/14149
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-07-12 12:09:43 -07:00
Rich Trott
0d22858d67
lib: remove excess indentation
...
In anticipation of stricter linting for indentation, remove instances of
extra indentation that will be flagged by the new rules.
PR-URL: https://github.com/nodejs/node/pull/14090
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-07-07 13:18:19 -07:00
Rich Trott
095c0de94d
benchmark,lib,test: use braces for multiline block
...
For if/else and loops where the bodies span more than one line, use
curly braces.
PR-URL: https://github.com/nodejs/node/pull/13828
Ref: https://github.com/nodejs/node/pull/13623#discussion_r123048602
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-06-23 14:43:20 -07:00
Brian White
448c4c62d2
child_process: do not extend result for *Sync()
...
PR-URL: https://github.com/nodejs/node/pull/13601
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-06-13 19:19:16 -04:00
Gil Tayar
8d7f07f379
child_process: promisify includes stdio in error
...
This converts the initial implementation of a promised exec that used
the customPromisifyArgs support in util.promisify with a custom
implementation. This is because exec and execFile, when there is an
error, still supply the stdout and stderr of the process, and yet
the promisified version with customPromisifyArgs does
not supply this ability.
I created a custom implementation and attached it to exec and execFile
using the util.promisify.custom key.
Fixes: https://github.com/nodejs/node/issues/13364
PR-URL: https://github.com/nodejs/node/pull/13388
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-06-09 21:46:09 +02:00
Anna Henningsen
fe5ca3ff27
child_process: support promisified exec(File)
...
Author: Benjamin Gruenbaum <inglor@gmail.com >
Author: Anna Henningsen <anna@addaleax.net >
PR-URL: https://github.com/nodejs/node/pull/12442
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: William Kapke <william.kapke@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
2017-05-09 15:01:45 +02:00
Sakthipriyan Vairamani (thefourtheye)
d75fdd96aa
child_process: improve killSignal validations
...
As it is, the `killSignal` is just retrieved from an object and used.
If the signal passed is actually one of the inherited properties of
that object, Node.js will die. For example,
➜ node -e "child_process.spawnSync('ls', {killSignal: 'toString'})"
Assertion failed: (0), function uv_close, file ....core.c, line 166.
[1] 58938 abort node -e "child_process.spawnSync(...)"
1. This patch makes sure that the signal is actually a own property of
the constants object.
2. Extends the killSignal validation to all the other functions.
PR-URL: https://github.com/nodejs/node/pull/10423
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-04-04 13:02:51 +05:30
Jackson Tian
dc9717c805
lib: clarify the usage of 'else'
...
The keyword 'else' is unnecessary after 'throw' statements.
PR-URL: https://github.com/nodejs/node/pull/11148
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
2017-03-26 12:14:11 +02:00
James M Snell
98e54b0bd4
meta: restore original copyright header
...
A prior io.js era commit inappropriately removed the
original copyright statements from the source. This
restores those in any files still remaining from that
edit.
Ref: https://github.com/nodejs/TSC/issues/174
Ref: https://github.com/nodejs/node/pull/10599
PR-URL: https://github.com/nodejs/node/pull/10155
Note: This PR was required, reviewed-by and approved
by the Node.js Foundation Legal Committee and the TSC.
There is no `Approved-By:` meta data.
2017-03-10 11:23:48 -08:00
Vse Mozhet Byt
dd81d539e2
child_process: fix deoptimizing use of arguments
...
Removed or fixed use of arguments in execFile(),
normalizeExecArgs(), and normalizeSpawnArguments().
Refs: https://github.com/nodejs/node/issues/10323
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=6010
PR-URL: https://github.com/nodejs/node/pull/11535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2017-03-01 10:24:03 -05:00
Sakthipriyan Vairamani (thefourtheye)
dce37dc35b
lib: remove unnecessary assignments with _extend
...
The first parameter to `util._extend` is the target object. Assigning
the target object to the result of `util._extend` is not necessary.
PR-URL: https://github.com/nodejs/node/pull/11364
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2017-02-22 10:35:25 +05:30
Michaël Zasso
193468667b
tools: enable one-var-declaration-per-line ESLint rule
...
This rule enforces new lines around variable declarations. It is
configured to spot only variables that are initialized.
PR-URL: https://github.com/nodejs/node/pull/11462
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-02-21 12:53:19 +01:00
cjihrig
a1c652ae60
child_process: remove empty if condition
...
This commit replaces an empty if-else-if with a single if
condition.
PR-URL: https://github.com/nodejs/node/pull/11427
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
2017-02-18 15:55:33 +01:00
Sam Roberts
4cafa60c99
child_process: align fork/spawn stdio error msg
...
fork()'s support for .stdio strings in 3268863eb used a different
TypeError string from spawn, unnecessarily.
PR-URL: https://github.com/nodejs/node/pull/11044
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2017-02-11 14:06:26 -08:00
James M Snell
5de3cf099c
lib: add static identifier codes for all deprecations
...
Assigns a static identifier code to all runtime and documentation
only deprecations. The identifier code is included in the emitted
DeprecationWarning.
Also adds a deprecations.md to the API docs to provide a central
location where deprecation codes can be referenced and explained.
PR-URL: https://github.com/nodejs/node/pull/10116
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Michal Zasso <targos@protonmail.com >
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com >
2017-01-30 11:11:57 -08:00
Javis Sullivan
3268863ebc
child_process: add string shortcut for fork stdio
...
Add string shortcut option for stdio parameter.
Fixes: https://github.com/nodejs/node/issues/10793
PR-URL: https://github.com/nodejs/node/pull/10866
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Brian White <mscdex@mscdex.net >
2017-01-27 12:06:48 -08:00
cjihrig
8f3ff98f0e
child_process: allow Infinity as maxBuffer value
...
Fixes: https://github.com/nodejs/node/pull/10767
PR-URL: https://github.com/nodejs/node/pull/10769
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-01-17 10:47:28 -05:00
Anna Henningsen
627ecee9ed
child_process: support Uint8Array input to methods
...
Support `Uint8Array` input to all the synchronous methods.
PR-URL: https://github.com/nodejs/node/pull/10653
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michal Zasso <targos@protonmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-01-10 11:35:45 -08:00
cjihrig
fc7b0dda85
child_process: improve input validation
...
This commit applies stricter input validation in
normalizeSpawnArguments(), which is run by all of the
child_process methods. Additional checks are added for spawnSync()
specific inputs.
Fixes: https://github.com/nodejs/node/issues/8096
Fixes: https://github.com/nodejs/node/issues/8539
Refs: https://github.com/nodejs/node/issues/9722
PR-URL: https://github.com/nodejs/node/pull/8312
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2016-12-25 12:48:46 -05:00
brad-decker
bbed075325
child_process: name anonymous functions
...
Refs: https://github.com/nodejs/node/issues/8913
PR-URL: https://github.com/nodejs/node/pull/9880
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
2016-12-05 07:35:52 -08:00
cjihrig
49d1c366d8
child_process: remove extra newline in errors
...
checkExecSyncError() creates error objects for execSync() and
execFileSync(). If the child process created stderr output, then
it is attached to the end of the error message. However, stderr
can be an empty Buffer object, which always passes the truthy
check, leading to an extra newline in the error message. This
commit adds a length check, which will work with both strings and
Buffers.
PR-URL: https://github.com/nodejs/node/pull/9343
Reviewed-By: Wyatt Preul <wpreul@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-11-02 19:25:32 -04:00
cjihrig
ec7c27f4cb
child_process: remove unreachable code
...
_convertCustomFds() is only called from normalizeSpawnArguments(),
which always provides an options object. Therefore, there is no
need to check for options in _convertCustomFds().
PR-URL: https://github.com/nodejs/node/pull/9307
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-10-29 13:29:58 -04:00
cjihrig
dd13d71eb3
child_process: remove unreachable execSync() code
...
Code coverage showed that the execSync() variable inheritStderr
was never set to the default value of true. This is because
the default case is hit whenever normalizeExecArgs() returns an
object without an 'options' property. However, this can never
be the case because normalizeExecArgs() unconditionally creates
the options object. This commit removes the unreachable code.
PR-URL: https://github.com/nodejs/node/pull/9209
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
2016-10-24 22:46:56 -04:00
Tanuja-Sawant
835fbeee00
child_process: update outdated comment
...
PR-URL: https://github.com/nodejs/node/pull/8988/
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-10-14 09:00:47 -07:00
Bartosz Sosnowski
b90f3da9de
child_process, win: fix shell spawn with AutoRun
...
Under Windows system can be configured to execute a specific command
each time a shell is spawned. Under some conditions this breaks the
way node handles shell scripts under windows.
This commit adds /d switch to spawn and spawnSync which disables this
AutoRun functionality.
Fixes: https://github.com/nodejs/node-v0.x-archive/issues/25458
PR-URL: https://github.com/nodejs/node/pull/8063
Reviewed-By: João Reis <reis@janeasystems.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Josh Gavant <josh.gavant@outlook.com >
Reviewed-By: Rod Vagg <rod@vagg.org >
2016-09-09 20:51:43 +02:00