child_process: preserve argument type
Checklist
-
make -j4 test
(UNIX) orvcbuild test nosign
(Windows) passes -
a test and/or benchmark is included -
the commit message follows commit guidelines
Affected core subsystem(s)
child_process
Description of change
A previous fix for a maxBuffer
bug resulted in a change to the
argument type for the data
event on child.stdin
and child.stdout
when using child_process.exec()
.
This fixes the maxBuffer
bug in a way that does not have that side
effect.
Fixes: https://github.com/nodejs/node/issues/7342 Refs: https://github.com/nodejs/node/issues/1901
Alternative to #7381 (which changes the argument type and is arguably semver-major
for that reason--being affected by it requires relying on undocumented behavior and using exec()
in ways that are better suited to fork()
or spawn()
which are unaffected by either fix).