diff options
author | Daniel Bevenius <daniel.bevenius@gmail.com> | 2017-05-07 13:59:49 +0200 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2017-05-11 07:13:14 +0200 |
commit | 54d331895c721fa85dc0ee237a3bbc04da3a324d (patch) | |
tree | bc44fdabe2915212d7116c6784ef903e9ab5ec31 /lib | |
parent | 6914aeaefd55b0b57364e70d0ef4374040539792 (diff) | |
download | android-node-v8-54d331895c721fa85dc0ee237a3bbc04da3a324d.tar.gz android-node-v8-54d331895c721fa85dc0ee237a3bbc04da3a324d.tar.bz2 android-node-v8-54d331895c721fa85dc0ee237a3bbc04da3a324d.zip |
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
3f48ab30420981f888ff2c69fc1ea5abb37f3f2e ("inspector: do not add
'inspector' property").
This commit attempts to fix this.
PR-URL: https://github.com/nodejs/node/pull/12881
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/bootstrap_node.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index b93b817aba..86875566b0 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -261,7 +261,9 @@ enumerable: true, get: function() { if (!console) { - console = installInspectorConsole(originalConsole); + console = originalConsole === undefined ? + NativeModule.require('console') : + installInspectorConsole(originalConsole); } return console; } |