OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of _interceptors; | 5 part of _interceptors; |
6 | 6 |
7 /** | 7 /** |
8 * The interceptor class for [String]. The compiler recognizes this | 8 * The interceptor class for [String]. The compiler recognizes this |
9 * class as an interceptor, and changes references to [:this:] to | 9 * class as an interceptor, and changes references to [:this:] to |
10 * actually use the receiver of the method, which is generated as an extra | 10 * actually use the receiver of the method, which is generated as an extra |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 return stringContainsUnchecked(this, other, startIndex); | 123 return stringContainsUnchecked(this, other, startIndex); |
124 } | 124 } |
125 | 125 |
126 bool get isEmpty => length == 0; | 126 bool get isEmpty => length == 0; |
127 | 127 |
128 int compareTo(String other) { | 128 int compareTo(String other) { |
129 if (other is !String) throw new ArgumentError(other); | 129 if (other is !String) throw new ArgumentError(other); |
130 return this == other ? 0 | 130 return this == other ? 0 |
131 : JS('bool', r'# < #', this, other) ? -1 : 1; | 131 : JS('bool', r'# < #', this, other) ? -1 : 1; |
132 } | 132 } |
| 133 |
| 134 String toString() => this; |
133 } | 135 } |
OLD | NEW |