Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Unified Diff: sdk/lib/core/int.dart

Issue 54203002: Update documentation on .fromEnvironment. Make bool default be false. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added examples. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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});
}
« sdk/lib/core/bool.dart ('K') | « sdk/lib/core/bool.dart ('k') | sdk/lib/core/string.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698