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

Unified Diff: third_party/WebKit/Source/devtools/front_end/text_utils/Text.js

Issue 2769843003: DevTools: split text_utils out of common module (Closed)
Patch Set: 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/text_utils/Text.js
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Text.js b/third_party/WebKit/Source/devtools/front_end/text_utils/Text.js
similarity index 86%
rename from third_party/WebKit/Source/devtools/front_end/common/Text.js
rename to third_party/WebKit/Source/devtools/front_end/text_utils/Text.js
index 30cea1b1675422a5668ecb91a390d634b7998998..d2a723961d4514c4c7fcbdf4eff0a07f57f94a4b 100644
--- a/third_party/WebKit/Source/devtools/front_end/common/Text.js
+++ b/third_party/WebKit/Source/devtools/front_end/text_utils/Text.js
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-self['Common'] = self['Common'] || {};
+self['TextUtils'] = self['TextUtils'] || {};
dgozman 2017/03/22 22:54:12 Can we remove this line?
lushnikov 2017/03/23 00:50:50 Done.
/**
* @unrestricted
*/
-Common.Text = class {
+TextUtils.Text = class {
/**
* @param {string} value
*/
@@ -50,7 +50,7 @@ Common.Text = class {
/**
* @param {number} offset
- * @return {!Common.Text.Position}
+ * @return {!TextUtils.Text.Position}
*/
positionFromOffset(offset) {
var lineEndings = this.lineEndings();
@@ -72,22 +72,22 @@ Common.Text = class {
}
/**
- * @param {!Common.TextRange} range
- * @return {!Common.SourceRange}
+ * @param {!TextUtils.TextRange} range
+ * @return {!TextUtils.SourceRange}
*/
toSourceRange(range) {
var start = this.offsetFromPosition(range.startLine, range.startColumn);
var end = this.offsetFromPosition(range.endLine, range.endColumn);
- return new Common.SourceRange(start, end - start);
+ return new TextUtils.SourceRange(start, end - start);
}
/**
- * @param {!Common.SourceRange} sourceRange
- * @return {!Common.TextRange}
+ * @param {!TextUtils.SourceRange} sourceRange
+ * @return {!TextUtils.TextRange}
*/
toTextRange(sourceRange) {
- var cursor = new Common.TextCursor(this.lineEndings());
- var result = Common.TextRange.createFromLocation(0, 0);
+ var cursor = new TextUtils.TextCursor(this.lineEndings());
+ var result = TextUtils.TextRange.createFromLocation(0, 0);
cursor.resetTo(sourceRange.offset);
result.startLine = cursor.lineNumber();
@@ -100,7 +100,7 @@ Common.Text = class {
}
/**
- * @param {!Common.TextRange} range
+ * @param {!TextUtils.TextRange} range
* @param {string} replacement
* @return {string}
*/
@@ -111,7 +111,7 @@ Common.Text = class {
}
/**
- * @param {!Common.TextRange} range
+ * @param {!TextUtils.TextRange} range
* @return {string}
*/
extract(range) {
@@ -121,12 +121,12 @@ Common.Text = class {
};
/** @typedef {{lineNumber: number, columnNumber: number}} */
-Common.Text.Position;
+TextUtils.Text.Position;
/**
* @unrestricted
*/
-Common.TextCursor = class {
+TextUtils.TextCursor = class {
/**
* @param {!Array<number>} lineEndings
*/

Powered by Google App Engine
This is Rietveld 408576698