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

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

Issue 2769843003: DevTools: split text_utils out of common module (Closed)
Patch Set: rebaseline Created 3 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 f43be6452e90347cddf9ebf9af48900a6cfd2f8e..5318072e00c911ae12bb164aabb06d9f13bba025 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
@@ -46,8 +46,8 @@ Sources.SourceMapNamesResolver._scopeIdentifiers = function(scope) {
if (!content)
return Promise.resolve(/** @type {!Array<!Sources.SourceMapNamesResolver.Identifier>}*/ ([]));
- var text = new Common.Text(content);
- var scopeRange = new Common.TextRange(
+ var text = new TextUtils.Text(content);
+ var scopeRange = new TextUtils.TextRange(
startLocation.lineNumber, startLocation.columnNumber, endLocation.lineNumber, endLocation.columnNumber);
var scopeText = text.extract(scopeRange);
var scopeStart = text.toSourceRange(scopeRange).offset;
@@ -57,7 +57,7 @@ Sources.SourceMapNamesResolver._scopeIdentifiers = function(scope) {
}
/**
- * @param {!Common.Text} text
+ * @param {!TextUtils.Text} text
* @param {number} scopeStart
* @param {string} prefix
* @param {!Array<!{name: string, offset: number}>} identifiers
@@ -65,7 +65,7 @@ Sources.SourceMapNamesResolver._scopeIdentifiers = function(scope) {
*/
function onIdentifiers(text, scopeStart, prefix, identifiers) {
var result = [];
- var cursor = new Common.TextCursor(text.lineEndings());
+ var cursor = new TextUtils.TextCursor(text.lineEndings());
for (var i = 0; i < identifiers.length; ++i) {
var id = identifiers[i];
if (id.offset < prefix.length)
@@ -92,7 +92,7 @@ Sources.SourceMapNamesResolver._resolveScope = function(scope) {
if (!sourceMap)
return Promise.resolve(new Map());
- /** @type {!Map<string, !Common.Text>} */
+ /** @type {!Map<string, !TextUtils.Text>} */
var textCache = new Map();
identifiersPromise = Sources.SourceMapNamesResolver._scopeIdentifiers(scope).then(onIdentifiers);
scope[Sources.SourceMapNamesResolver._cachedIdentifiersSymbol] = identifiersPromise;
@@ -148,7 +148,7 @@ Sources.SourceMapNamesResolver._resolveScope = function(scope) {
!startEntry.sourceLineNumber || !startEntry.sourceColumnNumber || !endEntry.sourceLineNumber ||
!endEntry.sourceColumnNumber)
return Promise.resolve(/** @type {?string} */ (null));
- var sourceTextRange = new Common.TextRange(
+ var sourceTextRange = new TextUtils.TextRange(
startEntry.sourceLineNumber, startEntry.sourceColumnNumber, endEntry.sourceLineNumber,
endEntry.sourceColumnNumber);
var uiSourceCode =
@@ -160,7 +160,7 @@ Sources.SourceMapNamesResolver._resolveScope = function(scope) {
}
/**
- * @param {!Common.TextRange} sourceTextRange
+ * @param {!TextUtils.TextRange} sourceTextRange
* @param {?string} content
* @return {?string}
*/
@@ -169,7 +169,7 @@ Sources.SourceMapNamesResolver._resolveScope = function(scope) {
return null;
var text = textCache.get(content);
if (!text) {
- text = new Common.Text(content);
+ text = new TextUtils.Text(content);
textCache.set(content, text);
}
var originalIdentifier = text.extract(sourceTextRange).trim();
@@ -274,9 +274,9 @@ Sources.SourceMapNamesResolver._resolveExpression = function(
if (!content)
return Promise.resolve('');
- var text = new Common.Text(content);
+ var text = new TextUtils.Text(content);
var textRange = sourceMap.reverseMapTextRange(
- uiSourceCode.url(), new Common.TextRange(lineNumber, startColumnNumber, lineNumber, endColumnNumber));
+ uiSourceCode.url(), new TextUtils.TextRange(lineNumber, startColumnNumber, lineNumber, endColumnNumber));
var originalText = text.extract(textRange);
if (!originalText)
return Promise.resolve('');

Powered by Google App Engine
This is Rietveld 408576698