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

Unified Diff: sdk/lib/_internal/lib/core_patch.dart

Issue 48323003: Implement fromEnvironment on bool, int, String in dart2js. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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/_internal/lib/core_patch.dart
===================================================================
--- sdk/lib/_internal/lib/core_patch.dart (revision 29517)
+++ sdk/lib/_internal/lib/core_patch.dart (working copy)
@@ -102,6 +102,11 @@
int onError(String source) }) {
return Primitives.parseInt(source, radix, onError);
}
+
+ patch factory int.fromEnvironment(String name, {int defaultValue}) {
+ throw new UnsupportedError(
+ 'int.fromEnvironement can only be used as a const constructor');
+ }
}
patch class double {
@@ -219,8 +224,20 @@
}
return Primitives.stringFromCharCodes(charCodes);
}
+
+ patch factory String.fromEnvironment(String name, {String defaultValue}) {
+ throw new UnsupportedError(
+ 'String.fromEnvironement can only be used as a const constructor');
+ }
}
+patch class bool {
+ patch factory bool.fromEnvironment(String name) {
+ throw new UnsupportedError(
+ 'bool.fromEnvironement can only be used as a const constructor');
+ }
+}
+
patch class RegExp {
patch factory RegExp(String source,
{bool multiLine: false,

Powered by Google App Engine
This is Rietveld 408576698