Uh oh!
There was an error while loading. Please reload this page.
child_process: do not extend result for *Sync() - #13601
Conversation
cjihrig
commented
Jun 10, 2017
I agree that it is unexpected. It looks like this was the behavior going all the way back to at least 0.12.0. The tests referenced in this PR are all newer than that, so I'm not sure that the two things are related. @bnoordhuis or @sam-github do either of you know why the inputs were originally attached to the output? |
There was a problem hiding this comment.
I don't think it really matters much since we're already explicitly passing 'win32' to this function below here.
a19761a to
14f88feComparemscdex
commented
Jun 10, 2017
Forgot to re-add a removed test. New CI: https://ci.nodejs.org/job/node-test-pull-request/8594/ |
mscdex
commented
Jun 12, 2017
/cc @nodejs/ctc |
14f88fe to
1ed6eceComparejasnell
commented
Jun 13, 2017
sam-github
commented
Jun 13, 2017
Sorry, I don't know why they were added. Getting rid of them seems like a good idea. |
refack
commented
Jun 13, 2017
CITGM clean |
jasnell
commented
Jun 13, 2017
PR-URL: nodejs#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>
1ed6ece to
448c4c6CompareIn 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] nodejs#13601
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] #13601 PR-URL: #16060 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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] nodejs/node#13601 PR-URL: nodejs/node#16060 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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] nodejs/node#13601 PR-URL: nodejs/node#16060 Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
It appears that when the synchronous
child_processmethods were added, additional information such as user-provided/parsed options, etc. was being copied to the returned object. Not only is this undocumented/unexpected, but it looks like this may have only been done for the purposes of tests (to test normalized/default options for example).This PR extracts the actual sync spawning into an internal function which can then be monkey-patched as needed by tests.
I have also changed the errors returned by the
exec*Sync()methods so that it matches that of theErrorobject mutation done for the asyncexec*()methods (e.g.err.resultcontains the libuv error name for status codes less than 0).CI: https://ci.nodejs.org/job/node-test-pull-request/8593/
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)