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

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: Fix test. Remove reference to throwing from int.fromEnvironment 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
« no previous file with comments | « sdk/lib/core/bool.dart ('k') | sdk/lib/core/string.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/int.dart
diff --git a/sdk/lib/core/int.dart b/sdk/lib/core/int.dart
index 1c17a317b39002935fe4c7d65be09445ce2309d4..c06a3ee0f8d9fb40438055905a7db2cf1fa3bada 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].
+ *
+ * The result is the same as would be returned by:
+ *
+ * int.parse(const String.fromEnvironment(name, defaultValue: ""),
+ * (_) => defaultValue)
+ *
+ * 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});
}
« no previous file with comments | « 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