Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @param {string} value | 7 * @param {string} value |
| 8 */ | 8 */ |
| 9 WebInspector.Text = function(value) | 9 WebInspector.Text = function(value) |
| 10 { | 10 { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 | 122 |
| 123 /** | 123 /** |
| 124 * @return {number} | 124 * @return {number} |
| 125 */ | 125 */ |
| 126 offset: function() | 126 offset: function() |
| 127 { | 127 { |
| 128 return this._offset; | 128 return this._offset; |
| 129 }, | 129 }, |
| 130 | 130 |
| 131 /** | 131 /** |
| 132 * @param {number} offset | |
| 133 */ | |
| 134 setOffset: function(offset) | |
|
dgozman
2016/04/14 19:15:37
resetTo
lushnikov
2016/04/15 00:16:01
Done.
| |
| 135 { | |
| 136 this._offset = offset; | |
| 137 this._lineNumber = this._lineEndings.lowerBound(offset); | |
| 138 this._columnNumber = this._lineNumber ? this._offset - this._lineEndings [this._lineNumber - 1] - 1 : this._offset; | |
| 139 }, | |
| 140 | |
| 141 /** | |
| 132 * @return {number} | 142 * @return {number} |
| 133 */ | 143 */ |
| 134 lineNumber: function() | 144 lineNumber: function() |
| 135 { | 145 { |
| 136 return this._lineNumber; | 146 return this._lineNumber; |
| 137 }, | 147 }, |
| 138 | 148 |
| 139 /** | 149 /** |
| 140 * @return {number} | 150 * @return {number} |
| 141 */ | 151 */ |
| 142 columnNumber: function() | 152 columnNumber: function() |
| 143 { | 153 { |
| 144 return this._columnNumber; | 154 return this._columnNumber; |
| 145 } | 155 } |
| 146 } | 156 } |
| OLD | NEW |