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

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

Issue 2931143003: DevTools: make debugger's rawLocationToUILocation return nullable type (Closed)
Patch Set: add test Created 3 years, 6 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
Index: third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
index 504b8d3d0a79e07f01755997ac2ccff539e2f084..a806360c4e7987d27d7a136579afd8ae89fd2e16 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
@@ -274,10 +274,9 @@ Sources.CallStackSidebarPane = class extends UI.SimpleView {
contextMenu.appendItem(Common.UIString('Restart frame'), () => item.debuggerCallFrame.restart());
contextMenu.appendItem(Common.UIString('Copy stack trace'), this._copyStackTrace.bind(this));
var location = this._itemLocation(item);
- if (location) {
- var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location);
+ var uiLocation = location ? Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location) : null;
+ if (uiLocation)
this.appendBlackboxURLContextMenuItems(contextMenu, uiLocation.uiSourceCode);
- }
contextMenu.show();
}
@@ -361,10 +360,9 @@ Sources.CallStackSidebarPane = class extends UI.SimpleView {
continue;
var itemText = this._itemTitle(item);
var location = this._itemLocation(item);
- if (location) {
- var uiLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location);
+ var uiLocation = location ? Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(location) : null;
+ if (uiLocation)
itemText += ' (' + uiLocation.linkText(true /* skipTrim */) + ')';
- }
text.push(itemText);
}
InspectorFrontendHost.copyText(text.join('\n'));

Powered by Google App Engine
This is Rietveld 408576698