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

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

Issue 2857453002: DevTools: support resolving a UILocation to multiple raw script locations (Closed)
Patch Set: get rid of uniqueScriptId() Created 3 years, 8 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/SourceFormatter.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
index 4b60589d1d41edc8d496f5c1cf408df0f84a678b..73fd566f4fd19d21d86fba14d3e47289296c8f42 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
@@ -155,17 +155,18 @@ Sources.SourceFormatter.ScriptMapping = class {
* @param {!Workspace.UISourceCode} uiSourceCode
* @param {number} lineNumber
* @param {number} columnNumber
- * @return {?SDK.DebuggerModel.Location}
+ * @return {!Array<!SDK.DebuggerModel.Location>}
*/
- uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) {
+ uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber) {
var formatData = Sources.SourceFormatData._for(uiSourceCode);
if (!formatData)
- return null;
+ return [];
var originalLocation = formatData.mapping.formattedToOriginal(lineNumber, columnNumber);
var scripts = this._scriptsForUISourceCode(formatData.originalSourceCode);
if (!scripts.length)
- return null;
- return scripts[0].debuggerModel.createRawLocation(scripts[0], originalLocation[0], originalLocation[1]);
+ return [];
+ var location = scripts[0].debuggerModel.createRawLocation(scripts[0], originalLocation[0], originalLocation[1]);
+ return location ? [location] : [];
}
/**
@@ -225,9 +226,8 @@ Sources.SourceFormatter.ScriptMapping = class {
}
}
if (uiSourceCode.contentType().isScript()) {
- var rawLocation = Bindings.debuggerWorkspaceBinding.uiLocationToRawLocation(uiSourceCode, 0, 0);
- if (rawLocation)
- return [rawLocation.script()];
+ return Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations(uiSourceCode, 0, 0)
+ .map(location => location.script());
}
return [];
}

Powered by Google App Engine
This is Rietveld 408576698