Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(484)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js

Issue 2742653003: [DevTools] chaotic green dots displacement fix (Closed)
Patch Set: addressed comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
index 265139b8b5ed9b1381d9e6a67942c229eb092e6c..70b25355bdb930d07f08cb3dc0e10fa89ffe23ce 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
@@ -595,9 +595,15 @@ Sources.JavaScriptSourceFrame = class extends SourceFrame.UISourceCodeFrame {
var callFrame = UI.context.flavor(SDK.DebuggerModel.CallFrame);
if (!callFrame)
return;
+ if (this._clearContinueToLocationsTimer) {
+ clearTimeout(this._clearContinueToLocationsTimer);
+ delete this._clearContinueToLocationsTimer;
+ }
var localScope = callFrame.localScope();
- if (!localScope)
+ if (!localScope) {
+ this.textEditor.operation(clearExistingLocations.bind(this));
return;
+ }
var start = localScope.startLocation();
var end = localScope.endLocation();
var debuggerModel = callFrame.debuggerModel;
@@ -605,20 +611,12 @@ Sources.JavaScriptSourceFrame = class extends SourceFrame.UISourceCodeFrame {
debuggerModel.getPossibleBreakpoints(start, end, true)
.then(locations => this.textEditor.operation(renderLocations.bind(this, locations)));
- if (this._clearContinueToLocationsTimer) {
- clearTimeout(this._clearContinueToLocationsTimer);
- delete this._clearContinueToLocationsTimer;
- }
-
/**
* @param {!Array<!SDK.DebuggerModel.BreakLocation>} locations
* @this {Sources.JavaScriptSourceFrame}
*/
function renderLocations(locations) {
- var bookmarks = this.textEditor.bookmarks(
- this.textEditor.fullRange(), Sources.JavaScriptSourceFrame.continueToLocationDecorationSymbol);
- bookmarks.map(bookmark => bookmark.clear());
-
+ clearExistingLocations.call(this);
for (var location of locations) {
var icon;
var isCurrent = location.lineNumber === executionLocation.lineNumber &&
@@ -648,6 +646,15 @@ Sources.JavaScriptSourceFrame = class extends SourceFrame.UISourceCodeFrame {
}
/**
+ * @this {Sources.JavaScriptSourceFrame}
+ */
+ function clearExistingLocations() {
+ var bookmarks = this.textEditor.bookmarks(
+ this.textEditor.fullRange(), Sources.JavaScriptSourceFrame.continueToLocationDecorationSymbol);
+ bookmarks.map(bookmark => bookmark.clear());
+ }
+
+ /**
* @param {!Event} event
* @this {Sources.JavaScriptSourceFrame}
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698