Chromium Code Reviews| 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 dart.core; | 5 part of dart.core; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A sequence of characters. | 8 * A sequence of characters. |
| 9 * | 9 * |
| 10 * A string can be either single or multiline. Single line strings are | 10 * A string can be either single or multiline. Single line strings are |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 * | 118 * |
| 119 * Creating a String with half of a surrogate pair is legal but generally | 119 * Creating a String with half of a surrogate pair is legal but generally |
| 120 * discouraged. | 120 * discouraged. |
| 121 */ | 121 */ |
| 122 factory String.fromCharCode(int charCode) { | 122 factory String.fromCharCode(int charCode) { |
| 123 List<int> charCodes = new List<int>.filled(1, charCode); | 123 List<int> charCodes = new List<int>.filled(1, charCode); |
| 124 return new String.fromCharCodes(charCodes); | 124 return new String.fromCharCodes(charCodes); |
| 125 } | 125 } |
| 126 | 126 |
| 127 /** | 127 /** |
| 128 * Returns the string for the given environment variable [name] or | |
|
Ivan Posva
2013/09/27 07:21:01
Maybe it should say "for the given configuration v
kasperl
2013/09/27 07:32:43
Nit: I don't think we should limit ourselves to en
Ivan Posva
2013/09/27 21:05:06
That is why had the remark about changing the comm
| |
| 129 * [defaultValue] if [name] is not present. | |
| 130 */ | |
| 131 external const String.env(String name, String defaultValue); | |
|
bakster
2013/09/27 07:44:39
How about adding a default value to defaultValue?
Ivan Posva
2013/09/27 21:05:06
I was thinking the same thing, but instead I would
| |
| 132 | |
| 133 /** | |
| 128 * Gets the character (as a single-code-unit [String]) at the given [index]. | 134 * Gets the character (as a single-code-unit [String]) at the given [index]. |
| 129 * | 135 * |
| 130 * The returned string represents exactly one UTF-16 code unit, which may be | 136 * The returned string represents exactly one UTF-16 code unit, which may be |
| 131 * half of a surrogate pair. A single member of a surrogate pair is an | 137 * half of a surrogate pair. A single member of a surrogate pair is an |
| 132 * invalid UTF-16 string: | 138 * invalid UTF-16 string: |
| 133 * | 139 * |
| 134 * var clef = '\u{1D11E}'; | 140 * var clef = '\u{1D11E}'; |
| 135 * // These represent invalid UTF-16 strings. | 141 * // These represent invalid UTF-16 strings. |
| 136 * clef[0].codeUnits; // [0xD834] | 142 * clef[0].codeUnits; // [0xD834] |
| 137 * clef[1].codeUnits; // [0xDD1E] | 143 * clef[1].codeUnits; // [0xDD1E] |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 649 _position = position - 1; | 655 _position = position - 1; |
| 650 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); | 656 _currentCodePoint = _combineSurrogatePair(prevCodeUnit, codeUnit); |
| 651 return true; | 657 return true; |
| 652 } | 658 } |
| 653 } | 659 } |
| 654 _position = position; | 660 _position = position; |
| 655 _currentCodePoint = codeUnit; | 661 _currentCodePoint = codeUnit; |
| 656 return true; | 662 return true; |
| 657 } | 663 } |
| 658 } | 664 } |
| OLD | NEW |