diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index 4a941b538592ce..1f202d2335f17a 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -33,12 +33,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, @@ -70,6 +64,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 00000000000000..c916be95b73fc0 --- /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); +}));