mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 05:21:19 +00:00

Wait for the `close` event before parsing the child stdout output. Fixes: https://github.com/nodejs/node/issues/6480 PR-URL: https://github.com/nodejs/node/pull/6575 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
22 lines
563 B
JavaScript
22 lines
563 B
JavaScript
'use strict';
|
|
require('../common');
|
|
var assert = require('assert');
|
|
var spawn = require('child_process').spawn;
|
|
|
|
if (process.argv[2] === 'child') {
|
|
process.stdout.write(JSON.stringify(process.execArgv));
|
|
} else {
|
|
var execArgv = ['--harmony_proxies', '--stack-size=256'];
|
|
var args = [__filename, 'child', 'arg0'];
|
|
var child = spawn(process.execPath, execArgv.concat(args));
|
|
var out = '';
|
|
|
|
child.stdout.on('data', function(chunk) {
|
|
out += chunk;
|
|
});
|
|
|
|
child.on('close', function() {
|
|
assert.deepStrictEqual(JSON.parse(out), execArgv);
|
|
});
|
|
}
|