| 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 /** | 5 /** |
| 6 * [_StringBase] contains common methods used by concrete String | 6 * [_StringBase] contains common methods used by concrete String |
| 7 * implementations, e.g., _OneByteString. | 7 * implementations, e.g., _OneByteString. |
| 8 */ | 8 */ |
| 9 class _StringBase { | 9 class _StringBase { |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 String operator [](int index) native "String_charAt"; | 32 String operator [](int index) native "String_charAt"; |
| 33 | 33 |
| 34 int codeUnitAt(int index) native "String_codeUnitAt"; | 34 int codeUnitAt(int index) native "String_codeUnitAt"; |
| 35 | 35 |
| 36 int get length native "String_getLength"; | 36 int get length native "String_getLength"; |
| 37 | 37 |
| 38 bool get isEmpty { | 38 bool get isEmpty { |
| 39 return this.length == 0; | 39 return this.length == 0; |
| 40 } | 40 } |
| 41 | 41 |
| 42 String concat(String other) native "String_concat"; | 42 String operator +(String other) native "String_concat"; |
| 43 |
| 44 String concat(String other) => this + other; |
| 43 | 45 |
| 44 String toString() { | 46 String toString() { |
| 45 return this; | 47 return this; |
| 46 } | 48 } |
| 47 | 49 |
| 48 bool operator ==(Object other) { | 50 bool operator ==(Object other) { |
| 49 if (identical(this, other)) { | 51 if (identical(this, other)) { |
| 50 return true; | 52 return true; |
| 51 } | 53 } |
| 52 if ((other is !String) || | 54 if ((other is !String) || |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 for (int g in groups) { | 599 for (int g in groups) { |
| 598 result.add(group(g)); | 600 result.add(group(g)); |
| 599 } | 601 } |
| 600 return result; | 602 return result; |
| 601 } | 603 } |
| 602 | 604 |
| 603 final int start; | 605 final int start; |
| 604 final String str; | 606 final String str; |
| 605 final String pattern; | 607 final String pattern; |
| 606 } | 608 } |
| OLD | NEW |