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 * An arbitrarily large integer. | 8 * An arbitrarily large integer. |
9 * | 9 * |
10 * **Note:** When compiling to JavaScript, integers are | 10 * **Note:** When compiling to JavaScript, integers are |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 * sign, the [onError] is called with the [source] as argument, and its return | 245 * sign, the [onError] is called with the [source] as argument, and its return |
246 * value is used instead. If no [onError] is provided, a [FormatException] | 246 * value is used instead. If no [onError] is provided, a [FormatException] |
247 * is thrown. | 247 * is thrown. |
248 * | 248 * |
249 * The [onError] function is only invoked if [source] is a [String]. It is | 249 * The [onError] function is only invoked if [source] is a [String]. It is |
250 * not invoked if the [source] is, for example, `null`. | 250 * not invoked if the [source] is, for example, `null`. |
251 */ | 251 */ |
252 external static int parse(String source, | 252 external static int parse(String source, |
253 { int radix, | 253 { int radix, |
254 int onError(String source) }); | 254 int onError(String source) }); |
| 255 |
| 256 /** |
| 257 * Returns the integer value of the given environment variable [name]. |
| 258 * The [defaultValue] is returned if [name] is not present in the environment |
| 259 * or if its value is not an integer. |
| 260 */ |
| 261 external const factory int.fromEnvironment(String name, |
| 262 {int defaultValue: 0}); |
255 } | 263 } |
OLD | NEW |