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

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

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

Powered by Google App Engine
This is Rietveld 408576698