Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debugger: remove duplicate setPauseOnException call #41838

Merged
merged 1 commit into from Feb 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/internal/debugger/inspect_repl.js
Expand Up @@ -1122,7 +1122,6 @@ function createRepl(inspector) {
await Profiler.enable();
await Profiler.setSamplingInterval({ interval: 100 });
await Debugger.enable();
await Debugger.setPauseOnExceptions({ state: 'none' });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this is duplicate? Note that these are async calls. It might be needed for the next two calls (to setAsyncCallStackDepth() and setBlackboxPatterns().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as anybody on the issue thread (#41795) could tell, there shouldn't be any reason to have this duplicated call, especially since the runtime is paused until runIfWaitingForDebugger below and can't trigger exceptions.

There are other places in tests where we set up a Debugger agent and it only calls `setPauseOnException once:

async function testBreakpointOnStart(session) {
console.log('[test]',
'Verifying debugger stops on start (--inspect-brk option)');
const commands = [
{ 'method': 'Runtime.enable' },
{ 'method': 'Debugger.enable' },
{ 'method': 'Debugger.setPauseOnExceptions',
'params': { 'state': 'none' } },
{ 'method': 'Debugger.setAsyncCallStackDepth',
'params': { 'maxDepth': 0 } },
{ 'method': 'Profiler.enable' },
{ 'method': 'Profiler.setSamplingInterval',
'params': { 'interval': 100 } },
{ 'method': 'Debugger.setBlackboxPatterns',
'params': { 'patterns': [] } },
{ 'method': 'Runtime.runIfWaitingForDebugger' },
];
await session.send(commands);
await session.waitForBreakOnLine(0, session.scriptURL());
}

await Debugger.setAsyncCallStackDepth({ maxDepth: 0 });
await Debugger.setBlackboxPatterns({ patterns: [] });
await Debugger.setPauseOnExceptions({ state: pauseOnExceptionState });
Expand Down