Skip to content

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 3f48ab30 ("inspector: do not add 'inspector' property").

This commit attempts to fix this.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines lib
Affected core subsystem(s)

Merge request reports

Loading