Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

update: add blackbox by default #99

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/internal-modules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

const fs = require('fs');

fs.readFile(__filename, function () {});
2 changes: 1 addition & 1 deletion lib/internal/inspect_repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ function createRepl(inspector) {
Debugger.enable(),
Debugger.setPauseOnExceptions({ state: 'none' }),
Debugger.setAsyncCallStackDepth({ maxDepth: 0 }),
Debugger.setBlackboxPatterns({ patterns: [] }),
Debugger.setBlackboxPatterns({ patterns: ['^node:'] }),
Debugger.setPauseOnExceptions({ state: pauseOnExceptionState }),
restoreBreakpoints(),
Runtime.runIfWaitingForDebugger(),
Expand Down
27 changes: 27 additions & 0 deletions test/cli/blackbox.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

const Path = require('path');

const { test } = require('tap');

const startCLI = require('./start-cli');

test('breakpoint inside node internal module', (t) => {
const script = Path.join('examples', 'internal-modules.js');
const cli = startCLI([script]);

function onFatal(error) {
cli.quit();
throw error;
}

return cli.waitForInitialBreak()
.then(() => cli.waitForPrompt())
.then(() => cli.stepCommand('n'))
.then(() => cli.stepCommand('s'))
.then(() => {
t.notMatch(cli.breakInfo.filename, /^node:/);
})
.then(() => cli.quit())
.then(null, onFatal);
});