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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.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/sdk/SourceMap.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
index 6ff41459509fc63009e271a4d5d4c1617c9b7967..626b08ccbc2180a503ef0301cf26996e011f5c43 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/SourceMap.js
@@ -345,23 +345,15 @@ SDK.TextSourceMap = class {
/**
* @param {string} sourceURL
* @param {number} lineNumber
- * @return {?SDK.SourceMapEntry}
+ * @return {!Array<!SDK.SourceMapEntry>}
*/
- firstSourceLineMapping(sourceURL, lineNumber) {
+ mappingsForLine(sourceURL, lineNumber) {
var mappings = this._reversedMappings(sourceURL);
- var index = mappings.lowerBound(lineNumber, lineComparator);
- if (index >= mappings.length || mappings[index].sourceLineNumber !== lineNumber)
- return null;
- return mappings[index];
-
- /**
- * @param {number} lineNumber
- * @param {!SDK.SourceMapEntry} mapping
- * @return {number}
- */
- function lineComparator(lineNumber, mapping) {
- return lineNumber - mapping.sourceLineNumber;
- }
+ var startIndex = mappings.lowerBound(lineNumber, (lineNumber, mapping) => lineNumber - mapping.sourceLineNumber);
+ var endIndex = startIndex;
+ while (endIndex < mappings.length && mappings[endIndex].sourceLineNumber === lineNumber)
+ ++endIndex;
+ return mappings.slice(startIndex, endIndex);
}
/**

Powered by Google App Engine
This is Rietveld 408576698