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 |
| 10 /* patch */ const factory String.fromEnvironment(String name, |
| 11 {String defaultValue}) |
| 12 native "String_fromEnvironment"; |
9 } | 13 } |
10 | 14 |
11 | 15 |
12 /** | 16 /** |
13 * [_StringBase] contains common methods used by concrete String | 17 * [_StringBase] contains common methods used by concrete String |
14 * implementations, e.g., _OneByteString. | 18 * implementations, e.g., _OneByteString. |
15 */ | 19 */ |
16 class _StringBase { | 20 class _StringBase { |
17 | 21 |
18 factory _StringBase._uninstantiable() { | 22 factory _StringBase._uninstantiable() { |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 class _CodeUnits extends Object with ListMixin<int>, | 690 class _CodeUnits extends Object with ListMixin<int>, |
687 UnmodifiableListMixin<int> { | 691 UnmodifiableListMixin<int> { |
688 /** The string that this is the code units of. */ | 692 /** The string that this is the code units of. */ |
689 String _string; | 693 String _string; |
690 | 694 |
691 _CodeUnits(this._string); | 695 _CodeUnits(this._string); |
692 | 696 |
693 int get length => _string.length; | 697 int get length => _string.length; |
694 int operator[](int i) => _string.codeUnitAt(i); | 698 int operator[](int i) => _string.codeUnitAt(i); |
695 } | 699 } |
OLD | NEW |