Index: third_party/WebKit/Source/devtools/front_end/common/TextRange.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/common/TextRange.js b/third_party/WebKit/Source/devtools/front_end/common/TextRange.js |
index a9b7f2728d7cb71b9a5f74805377d59d2828a68e..87ca0bf43d19169b1d0c831dd96a9c421010eb97 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/common/TextRange.js |
+++ b/third_party/WebKit/Source/devtools/front_end/common/TextRange.js |
@@ -225,17 +225,6 @@ WebInspector.TextRange.prototype = { |
}, |
/** |
- * @param {string} text |
- * @return {!WebInspector.SourceRange} |
- */ |
- toSourceRange: function(text) |
- { |
- var start = text.offsetFromPosition(this.startLine, this.startColumn); |
- var end = text.offsetFromPosition(this.endLine, this.endColumn); |
- return new WebInspector.SourceRange(start, end - start); |
- }, |
- |
- /** |
* @param {!WebInspector.TextRange} originalRange |
* @param {!WebInspector.TextRange} editedRange |
* @return {!WebInspector.TextRange} |
@@ -268,27 +257,6 @@ WebInspector.TextRange.prototype = { |
}, |
/** |
- * @param {string} text |
- * @param {string} replacement |
- * @return {string} |
- */ |
- replaceInText: function(text, replacement) |
- { |
- var sourceRange = this.toSourceRange(text); |
- return text.substring(0, sourceRange.offset) + replacement + text.substring(sourceRange.offset + sourceRange.length); |
- }, |
- |
- /** |
- * @param {string} text |
- * @return {string} |
- */ |
- extract: function(text) |
- { |
- var sourceRange = this.toSourceRange(text); |
- return text.substr(sourceRange.offset, sourceRange.length); |
- }, |
- |
- /** |
* @param {number} lineNumber |
* @param {number} columnNumber |
* @return {boolean} |
@@ -340,7 +308,7 @@ WebInspector.SourceRange = function(offset, length) |
WebInspector.SourceRange.prototype = { |
/** |
- * @param {string} text |
+ * @param {!WebInspector.Text} text |
* @return {!WebInspector.TextRange} |
*/ |
toTextRange: function(text) |
@@ -350,7 +318,7 @@ WebInspector.SourceRange.prototype = { |
return new WebInspector.TextRange(p1.lineNumber, p1.columnNumber, p2.lineNumber, p2.columnNumber); |
/** |
- * @param {string} text |
+ * @param {!WebInspector.Text} text |
* @param {number} offset |
* @return {!{lineNumber: number, columnNumber: number}} |
*/ |
@@ -387,11 +355,11 @@ WebInspector.SourceEdit.prototype = { |
}, |
/** |
- * @param {string} text |
- * @return {string} |
+ * @param {!WebInspector.Text} text |
+ * @return {!WebInspector.Text} |
*/ |
applyToText: function(text) |
dgozman
2016/03/16 20:36:48
Is this one used?
lushnikov
2016/03/16 21:04:01
There was a single client; i inlined it and remove
|
{ |
- return this.oldRange.replaceInText(text, this.newText); |
+ return new WebInspector.Text(text.replaceRange(this.oldRange, this.newText)); |
}, |
} |