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

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

Issue 1809533003: DevTools: remove illusionary caching from String.prototype.lineEndings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
index 27e62065bb59b8550eb8eda6571525b1a463bcca..a4104f99a9847a749d5bacf81617772a056ab43a 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
@@ -49,8 +49,9 @@ WebInspector.SourceMapNamesResolver._resolveScope = function(scope)
var endLocation = scope.endLocation();
var textRange = new WebInspector.TextRange(startLocation.lineNumber, startLocation.columnNumber, endLocation.lineNumber, endLocation.columnNumber);
- var scopeText = textRange.extract(content);
- var scopeStart = textRange.toSourceRange(content).offset;
+ var text = new WebInspector.Text(content);
+ var scopeText = text.extract(textRange);
+ var scopeStart = text.toSourceRange(textRange).offset;
var prefix = "function fui";
var root = acorn.parse(prefix + scopeText, {});
/** @type {!Array<!ESTree.Node>} */
@@ -212,8 +213,9 @@ WebInspector.SourceMapNamesResolver._resolveExpression = function(callFrame, uiS
if (!content)
return "";
+ var text = new WebInspector.Text(content);
var textRange = sourceMap.reverseMapTextRange(uiSourceCode.url(), new WebInspector.TextRange(lineNumber, startColumnNumber, lineNumber, endColumnNumber));
- var originalText = textRange.extract(content);
+ var originalText = text.extract(textRange);
if (!originalText)
return "";

Powered by Google App Engine
This is Rietveld 408576698