aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikolai Vavilov <vvnicholas@gmail.com>2017-10-27 21:23:59 +0300
committerNikolai Vavilov <vvnicholas@gmail.com>2017-10-29 20:59:24 +0200
commit403ccb68a5379bcf4892e35172730fd52d6d03b6 (patch)
tree62260da9c05a4d15cfaa8f3ac9726b2bf096a7e0 /lib
parente2ce1307ede31a30d52887e89c03342772885554 (diff)
downloadandroid-node-v8-403ccb68a5379bcf4892e35172730fd52d6d03b6.tar.gz
android-node-v8-403ccb68a5379bcf4892e35172730fd52d6d03b6.tar.bz2
android-node-v8-403ccb68a5379bcf4892e35172730fd52d6d03b6.zip
lib: setup IPC channel before console
Initializing IOCP on the same fd twice can fail on Windows. Consequently, if the IPC channel uses fd 1 or 2 and the console is setup first, writing to the IPC channel will fail. PR-URL: https://github.com/nodejs/node/pull/16562 Fixes: https://github.com/nodejs/node/issues/16141 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/bootstrap_node.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
index 9569d205ed..9755641b0d 100644
--- a/lib/internal/bootstrap_node.js
+++ b/lib/internal/bootstrap_node.js
@@ -37,12 +37,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,
@@ -74,6 +68,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');