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

Commit

Permalink
fix: Display breakpoints set into the future
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Krems committed Sep 8, 2016
1 parent 2db4660 commit f2ad1ae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/node-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,10 @@ function createCommandContext(inspector) {
return new Proxy(new RemoteObject(result), createRemoteObjectProxyHandler(inspector.client));
}

function handleBreakpointResolved({ breakpointId, location }) {
knownBreakpoints.set(breakpointId, location);
}

const ctx = {
get help() {
const commands = [
Expand Down Expand Up @@ -574,7 +578,7 @@ function createCommandContext(inspector) {
setBreakpoint(script, line, condition, silent) {
function registerBreakpoint({ breakpointId, actualLocation }) {
if (actualLocation) {
knownBreakpoints.set(breakpointId, actualLocation);
handleBreakpointResolved({ breakpointId, location: actualLocation });
if (!silent) return ctx.list(5);
} else {
print(`Warning: script '${script}' was not loaded yet.`);
Expand Down Expand Up @@ -786,7 +790,7 @@ function createCommandContext(inspector) {
.then(() => repl.displayPrompt());
});

// TODO: Debugger.on('breakpointResolved', ({ })
Debugger.on('breakpointResolved', handleBreakpointResolved);

Debugger.on('scriptParsed', ({ scriptId, url }) => {
if (url) {
Expand Down

0 comments on commit f2ad1ae

Please sign in to comment.