Chromium Code Reviews| Index: sdk/lib/core/int.dart |
| diff --git a/sdk/lib/core/int.dart b/sdk/lib/core/int.dart |
| index 1c17a317b39002935fe4c7d65be09445ce2309d4..8578bfe7fbb132123e867af9da01b594a94c597a 100644 |
| --- a/sdk/lib/core/int.dart |
| +++ b/sdk/lib/core/int.dart |
| @@ -19,6 +19,20 @@ part of dart.core; |
| */ |
| abstract class int extends num { |
| /** |
| + * Returns the integer value of the given environment declaration [name]. |
| + * |
| + * if `name` is not declared, the result is [defaultValue]. |
| + * |
| + * Throws a [FormatException] if the value in the environment is not a valid |
|
Søren Gjesse
2013/10/31 08:14:30
The VM implementation currently throws ArgumentErr
Lasse Reichstein Nielsen
2013/10/31 11:52:19
It also fails on other parts of the parsing. We sh
|
| + * integer, as accepted by [parse] with no radix. |
| + * |
| + * Example: |
| + * |
| + * const int.fromEnvironment("defaultPort", defaultValue: 80) |
| + */ |
| + external const factory int.fromEnvironment(String name, {int defaultValue}); |
| + |
| + /** |
| * Bit-wise and operator. |
| * |
| * Treating both `this` and [other] as sufficiently large two's component |
| @@ -252,12 +266,4 @@ abstract class int extends num { |
| external static int parse(String source, |
| { int radix, |
| int onError(String source) }); |
| - |
| - /** |
| - * Returns the integer value for the given environment variable |
| - * [name] or [defaultValue] if [name] is not present. If the value |
| - * of the environment variable is not a valid integer literal a |
| - * [FormatException] is thrown. |
| - */ |
| - external const factory int.fromEnvironment(String name, {int defaultValue}); |
| } |