mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-10 05:47:04 +00:00
Bug 886848 - Remove _skipEditorBreakpointCallbacks since it's redundant after using promises when handling breakpoints, r=past
This commit is contained in:
parent
c9b43473cb
commit
7453fee9c1
@ -1212,20 +1212,6 @@ Breakpoints.prototype = {
|
|||||||
* A map of breakpoint promises as tracked by the debugger frontend.
|
* A map of breakpoint promises as tracked by the debugger frontend.
|
||||||
* The keys consist of a string representation of the breakpoint location.
|
* The keys consist of a string representation of the breakpoint location.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Skip editor breakpoint change events.
|
|
||||||
*
|
|
||||||
* This property tells the source editor event handler to skip handling of
|
|
||||||
* the BREAKPOINT_CHANGE events. This is used when the debugger adds/removes
|
|
||||||
* breakpoints from the editor. Typically, the BREAKPOINT_CHANGE event handler
|
|
||||||
* adds/removes events from the debugger, but when breakpoints are added from
|
|
||||||
* the public debugger API, we need to do things in reverse.
|
|
||||||
*
|
|
||||||
* This implementation relies on the fact that the source editor fires the
|
|
||||||
* BREAKPOINT_CHANGE events synchronously.
|
|
||||||
*/
|
|
||||||
_skipEditorBreakpointCallbacks: false,
|
|
||||||
_added: new Map(),
|
_added: new Map(),
|
||||||
_removing: new Map(),
|
_removing: new Map(),
|
||||||
|
|
||||||
@ -1264,13 +1250,8 @@ Breakpoints.prototype = {
|
|||||||
* The SourceEditor.EVENTS.BREAKPOINT_CHANGE event object.
|
* The SourceEditor.EVENTS.BREAKPOINT_CHANGE event object.
|
||||||
*/
|
*/
|
||||||
_onEditorBreakpointChange: function(aEvent) {
|
_onEditorBreakpointChange: function(aEvent) {
|
||||||
if (this._skipEditorBreakpointCallbacks) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this._skipEditorBreakpointCallbacks = true;
|
|
||||||
aEvent.added.forEach(this._onEditorBreakpointAdd, this);
|
aEvent.added.forEach(this._onEditorBreakpointAdd, this);
|
||||||
aEvent.removed.forEach(this._onEditorBreakpointRemove, this);
|
aEvent.removed.forEach(this._onEditorBreakpointRemove, this);
|
||||||
this._skipEditorBreakpointCallbacks = false;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1545,9 +1526,7 @@ Breakpoints.prototype = {
|
|||||||
// Update the editor if required.
|
// Update the editor if required.
|
||||||
if (!aFlags.noEditorUpdate) {
|
if (!aFlags.noEditorUpdate) {
|
||||||
if (location.url == currentSourceUrl) {
|
if (location.url == currentSourceUrl) {
|
||||||
this._skipEditorBreakpointCallbacks = true;
|
|
||||||
DebuggerView.editor.addBreakpoint(location.line - 1);
|
DebuggerView.editor.addBreakpoint(location.line - 1);
|
||||||
this._skipEditorBreakpointCallbacks = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1581,9 +1560,7 @@ Breakpoints.prototype = {
|
|||||||
// Update the editor if required.
|
// Update the editor if required.
|
||||||
if (!aFlags.noEditorUpdate) {
|
if (!aFlags.noEditorUpdate) {
|
||||||
if (aLocation.url == currentSourceUrl) {
|
if (aLocation.url == currentSourceUrl) {
|
||||||
this._skipEditorBreakpointCallbacks = true;
|
|
||||||
DebuggerView.editor.removeBreakpoint(aLocation.line - 1);
|
DebuggerView.editor.removeBreakpoint(aLocation.line - 1);
|
||||||
this._skipEditorBreakpointCallbacks = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Update the breakpoints pane if required.
|
// Update the breakpoints pane if required.
|
||||||
|
Loading…
Reference in New Issue
Block a user