Chromium Code Reviews| Index: sdk/lib/core/bool.dart |
| diff --git a/sdk/lib/core/bool.dart b/sdk/lib/core/bool.dart |
| index c4348b7117300303f2ebc949c16a18562749f707..ef1515dd3eb5fb79a61d4cf1f69f14643833344a 100644 |
| --- a/sdk/lib/core/bool.dart |
| +++ b/sdk/lib/core/bool.dart |
| @@ -13,10 +13,29 @@ part of dart.core; |
| */ |
| class bool { |
| /** |
| - * Returns the boolean for the given environment variable [name] or |
| - * [defaultValue] if [name] is not present. |
| + * Returns the boolean value of the environment declaration [name]. |
| + * |
| + * The boolean value of the declaration is `true` if the declared value is |
| + * the string `"true"`. Otherwise it is false. |
| + * |
| + * If `name` is not declared, the result is instead [defaultValue]. |
| + * |
| + * This constructor is equivalent to: |
| + * |
| + * const String.fromEnvironment(name, |
| + * defaultValue: "$defaultValue") == "true" |
| + * |
| + * Example: |
| + * |
| + * var useFlooFlag = const bool.fromEnvironment("floo"); |
|
Søren Gjesse
2013/10/31 08:14:30
Maybe write something more useful here, e.g floo -
Lasse Reichstein Nielsen
2013/10/31 11:52:19
Done.
|
| + * |
| + * If you want to use a different truth-string, you can use the |
| + * [String.fromEnvironment] constructor directly: |
| + * |
| + * var isFlooOn = const String.fromEnvironment("flooFlag") == "on"; |
| */ |
| - external const factory bool.fromEnvironment(String name, {bool defaultValue}); |
| + external const factory bool.fromEnvironment(String name, |
| + {bool defaultValue: false}); |
| /** |
| * Returns [:"true":] if the receiver is [:true:], or [:"false":] if the |