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

Unified Diff: sdk/lib/core/string.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/int.dart ('k') | tests/corelib/bool_from_environment_default_value_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/string.dart
diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart
index 8da434e7d520d7135dd0a571f7e031e34cbc3f28..799a2a96837e06652a54cb6cfb6b243d1ebea063 100644
--- a/sdk/lib/core/string.dart
+++ b/sdk/lib/core/string.dart
@@ -125,8 +125,22 @@ abstract class String implements Comparable<String>, Pattern {
}
/**
- * Returns the string for the given environment variable [name] or
- * [defaultValue] if [name] is not present.
+ * Returns the string value of the environment declaration [name].
+ *
+ * Environment declarations are provided by the surrounding system compiling
+ * or running the Dart program. Declarations map a string key to a string
+ * value.
+ *
+ * If [name] is not declared in the environment, the result is instead
+ * [defaultValue].
+ *
+ * Example of getting a value:
+ *
+ * const String.fromEnvironment("defaultFloo", defaultValue: "no floo")
+ *
+ * Example of checking whether a declaration is there at all:
+ *
+ * var isDeclared = const String.fromEnvironment("maybeDeclared") != null;
*/
external const factory String.fromEnvironment(String name,
{String defaultValue});
« no previous file with comments | « sdk/lib/core/int.dart ('k') | tests/corelib/bool_from_environment_default_value_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698