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

Commit f2ad1ae

Browse files
author
Jan Krems
committed
fix: Display breakpoints set into the future
1 parent 2db4660 commit f2ad1ae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/node-inspect.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,10 @@ function createCommandContext(inspector) {
515515
return new Proxy(new RemoteObject(result), createRemoteObjectProxyHandler(inspector.client));
516516
}
517517

518+
function handleBreakpointResolved({ breakpointId, location }) {
519+
knownBreakpoints.set(breakpointId, location);
520+
}
521+
518522
const ctx = {
519523
get help() {
520524
const commands = [
@@ -574,7 +578,7 @@ function createCommandContext(inspector) {
574578
setBreakpoint(script, line, condition, silent) {
575579
function registerBreakpoint({ breakpointId, actualLocation }) {
576580
if (actualLocation) {
577-
knownBreakpoints.set(breakpointId, actualLocation);
581+
handleBreakpointResolved({ breakpointId, location: actualLocation });
578582
if (!silent) return ctx.list(5);
579583
} else {
580584
print(`Warning: script '${script}' was not loaded yet.`);
@@ -786,7 +790,7 @@ function createCommandContext(inspector) {
786790
.then(() => repl.displayPrompt());
787791
});
788792

789-
// TODO: Debugger.on('breakpointResolved', ({ })
793+
Debugger.on('breakpointResolved', handleBreakpointResolved);
790794

791795
Debugger.on('scriptParsed', ({ scriptId, url }) => {
792796
if (url) {

0 commit comments

Comments
 (0)