-
Notifications
You must be signed in to change notification settings - Fork 51
Adjust api breakpoint if resolved in another line #330
Conversation
Change api type breakpoint location line number if the breakpoint was originally set to a line with only comments. The new line that breakpoint set to will be actual paused line in code.
src/agent/state.ts
Outdated
return { | ||
location: {line: this.state_.frame(0).sourceLine()} as |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/agent/v8debugapi.ts
Outdated
@@ -612,6 +612,11 @@ export function create( | |||
// TODO: Address the case where `breakpoint.expression` is `undefined`. | |||
const captured = state.capture( | |||
execState, breakpoint.expressions as string[], config, v8); | |||
if (breakpoint.location !== undefined && |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
test/test-v8debugapi.ts
Outdated
@@ -500,6 +500,29 @@ describe('v8debugapi', function() { | |||
|
|||
}); | |||
|
|||
it('should resolve correct breakpoint line number', function(done) { | |||
// clone a clean breakpointInFoo | |||
// TODO: Have this actually implement Breakpoint |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
test/test-v8debugapi.ts
Outdated
@@ -500,6 +500,29 @@ describe('v8debugapi', function() { | |||
|
|||
}); | |||
|
|||
it('should resolve correct breakpoint line number', function(done) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nit.
src/agent/v8debugapi.ts
Outdated
@@ -612,6 +612,8 @@ export function create( | |||
// TODO: Address the case where `breakpoint.expression` is `undefined`. | |||
const captured = state.capture( | |||
execState, breakpoint.expressions as string[], config, v8); | |||
if (breakpoint.location && captured.location && captured.location.line) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Change api type breakpoint location line number if the breakpoint was
originally set to a line with only comments. The new line that
breakpoint set to will be actual paused line in code.