Index: third_party/WebKit/Source/devtools/front_end/platform/utilities.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/platform/utilities.js b/third_party/WebKit/Source/devtools/front_end/platform/utilities.js |
index 803caaf1eeae8a5370ced9c636ce15618ecc11cd..8c5f74e0d81c5c0e778b6cbeb403b337630661ea 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/platform/utilities.js |
+++ b/third_party/WebKit/Source/devtools/front_end/platform/utilities.js |
@@ -114,44 +114,9 @@ String.prototype.isWhitespace = function() |
*/ |
String.prototype.lineEndings = function() |
dgozman
2016/03/16 20:36:48
Why don't we remove this method?
lushnikov
2016/03/16 21:04:01
It still comes handy in formatter worker.
|
{ |
- if (!this._lineEndings) { |
- this._lineEndings = this.findAll("\n"); |
- this._lineEndings.push(this.length); |
- } |
- return this._lineEndings; |
-} |
- |
-/** |
- * @return {number} |
- */ |
-String.prototype.lineCount = function() |
-{ |
- var lineEndings = this.lineEndings(); |
- return lineEndings.length; |
-} |
- |
-/** |
- * @param {number} lineNumber |
- * @param {number} columNumber |
- * @return {number} |
- */ |
-String.prototype.offsetFromPosition = function(lineNumber, columNumber) |
-{ |
- return (lineNumber ? this.lineEndings()[lineNumber - 1] + 1 : 0) + columNumber; |
-} |
- |
-/** |
- * @return {string} |
- */ |
-String.prototype.lineAt = function(lineNumber) |
-{ |
- var lineEndings = this.lineEndings(); |
- var lineStart = lineNumber > 0 ? lineEndings[lineNumber - 1] + 1 : 0; |
- var lineEnd = lineEndings[lineNumber]; |
- var lineContent = this.substring(lineStart, lineEnd); |
- if (lineContent.length > 0 && lineContent.charAt(lineContent.length - 1) === "\r") |
- lineContent = lineContent.substring(0, lineContent.length - 1); |
- return lineContent; |
+ var endings = this.findAll("\n"); |
+ endings.push(this.length); |
+ return endings; |
} |
/** |