| 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 patch class String { | 5 patch class String { |
| 6 /* patch */ factory String.fromCharCodes(Iterable<int> charCodes) { | 6 /* patch */ factory String.fromCharCodes(Iterable<int> charCodes) { |
| 7 return _StringBase.createFromCharCodes(charCodes); | 7 return _StringBase.createFromCharCodes(charCodes); |
| 8 } | 8 } |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 int get length native "String_getLength"; | 67 int get length native "String_getLength"; |
| 68 | 68 |
| 69 bool get isEmpty { | 69 bool get isEmpty { |
| 70 return this.length == 0; | 70 return this.length == 0; |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool get isNotEmpty => !isEmpty; | 73 bool get isNotEmpty => !isEmpty; |
| 74 | 74 |
| 75 String operator +(String other) native "String_concat"; | 75 String operator +(String other) native "String_concat"; |
| 76 | 76 |
| 77 String concat(String other) => this + other; | |
| 78 | |
| 79 String toString() { | 77 String toString() { |
| 80 return this; | 78 return this; |
| 81 } | 79 } |
| 82 | 80 |
| 83 bool operator ==(Object other) { | 81 bool operator ==(Object other) { |
| 84 if (identical(this, other)) { | 82 if (identical(this, other)) { |
| 85 return true; | 83 return true; |
| 86 } | 84 } |
| 87 if ((other is !String) || | 85 if ((other is !String) || |
| 88 (this.length != other.length)) { | 86 (this.length != other.length)) { |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 class _CodeUnits extends Object with ListMixin<int>, | 634 class _CodeUnits extends Object with ListMixin<int>, |
| 637 UnmodifiableListMixin<int> { | 635 UnmodifiableListMixin<int> { |
| 638 /** The string that this is the code units of. */ | 636 /** The string that this is the code units of. */ |
| 639 String _string; | 637 String _string; |
| 640 | 638 |
| 641 _CodeUnits(this._string); | 639 _CodeUnits(this._string); |
| 642 | 640 |
| 643 int get length => _string.length; | 641 int get length => _string.length; |
| 644 int operator[](int i) => _string.codeUnitAt(i); | 642 int operator[](int i) => _string.codeUnitAt(i); |
| 645 } | 643 } |
| OLD | NEW |