Skip to content

Commit 54d3318

Browse files
committed
lib: add guard to originalConsole
Currently when building --without-ssl or --without-inspector there will be an error when trying to set up the console in bootstrap_node.js: Can't determine the arch of: 'out/Release/node' bootstrap_node.js:276 if (!globalConsole.hasOwnProperty(key)) ^ TypeError: Cannot read property 'hasOwnProperty' of undefined at installInspectorConsole (bootstrap_node.js:276:25) at get (bootstrap_node.js:264:21) at evalScript (bootstrap_node.js:395:30) at startup (bootstrap_node.js:125:9) at bootstrap_node.js:537:3 I think this issue was introduced in commit 3f48ab3 ("inspector: do not add 'inspector' property"). This commit attempts to fix this. PR-URL: #12881 Reviewed-By: Eugene Ostroukhov <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 6914aea commit 54d3318

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/bootstrap_node.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@
261261
enumerable: true,
262262
get: function() {
263263
if (!console) {
264-
console = installInspectorConsole(originalConsole);
264+
console = originalConsole === undefined ?
265+
NativeModule.require('console') :
266+
installInspectorConsole(originalConsole);
265267
}
266268
return console;
267269
}

0 commit comments

Comments
 (0)