-
Notifications
You must be signed in to change notification settings - Fork 683
Add delete all breakpoints feature to debugger (javascript) #1628
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -828,7 +828,23 @@ <h2>JerryScript HTML (WebSocket) Debugger Client</h2> | |
{ | ||
breakpoint = activeBreakpoints[index]; | ||
|
||
if (!breakpoint) | ||
if (index == "all") | ||
{ | ||
var found = false; | ||
|
||
for (var i in activeBreakpoints) | ||
{ | ||
delete activeBreakpoints[i]; | ||
found = true; | ||
} | ||
|
||
if (!found) | ||
{ | ||
appendLog("No active breakpoints.") | ||
} | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this form would be better, whats your opinion? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can't use splice() function in the activeBreakpoints object. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's my bad, I thought that activeBreakpoints is an array. |
||
else if (!breakpoint) | ||
{ | ||
appendLog("No breakpoint found with index " + index); | ||
return; | ||
|
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.
Isn't there an easier way to check whether activeBreakpoints is empty?
Uh oh!
There was an error while loading. Please reload this page.
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.
You can check with
Object.keys(acviteBreakpoints).length
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.
That is more complicated. Keep the bool then.