Skip to content

Commit

Permalink
fixup! src: use internalBinding('config').hasInspector in JS land
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Jan 2, 2019
1 parent ac1a309 commit b249b07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/internal/bootstrap/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const cannotUseCache = [

// Skip modules that cannot be required when they are not
// built into the binary.
if (hasInspector) {
if (!hasInspector) {
cannotUseCache.push(
'inspector',
'internal/util/inspector',
Expand Down
5 changes: 3 additions & 2 deletions lib/internal/process/coverage.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,13 @@ function disableAllAsyncHooks() {
exports.writeCoverage = writeCoverage;

function setup() {
const { Connection } = internalBinding('inspector');
if (!Connection) {
const { hasInspector } = internalBinding('config');
if (!hasInspector) {
process._rawDebug('inspector not enabled');
return;
}

const { Connection } = internalBinding('inspector');
coverageConnection = new Connection((res) => {
if (coverageConnection._coverageCallback) {
coverageConnection._coverageCallback(res);
Expand Down

0 comments on commit b249b07

Please sign in to comment.