diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index 868a984e56..ad0b3612c3 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -40,12 +40,6 @@ NativeModule.require('internal/process/next_tick').setup(); NativeModule.require('internal/process/stdio').setup(); - const browserGlobals = !process._noBrowserGlobals; - if (browserGlobals) { - setupGlobalTimeouts(); - setupGlobalConsole(); - } - const perf = process.binding('performance'); const { NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE, @@ -77,6 +71,12 @@ _process.setupRawDebug(); + const browserGlobals = !process._noBrowserGlobals; + if (browserGlobals) { + setupGlobalTimeouts(); + setupGlobalConsole(); + } + // Ensure setURLConstructor() is called before the native // URL::ToObject() method is used. NativeModule.require('internal/url'); diff --git a/test/parallel/test-child-process-stdout-ipc.js b/test/parallel/test-child-process-stdout-ipc.js new file mode 100644 index 0000000000..c916be95b7 --- /dev/null +++ b/test/parallel/test-child-process-stdout-ipc.js @@ -0,0 +1,18 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +const spawn = require('child_process').spawn; + +if (process.argv[2] === 'child') { + process.send('hahah'); + return; +} + +const proc = spawn(process.execPath, [__filename, 'child'], { + stdio: ['inherit', 'ipc', 'inherit'] +}); + +proc.on('exit', common.mustCall(function(code) { + assert.strictEqual(code, 0); +}));