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

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

Issue 2896393003: Remove factory body in *.fromEnvironment, and implement this same behavior (Closed)
Patch Set: address comments and fix unit test Created 3 years, 7 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/js_runtime/lib/core_patch.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index 3dfa7f068e95143ece9566df9201230cdce72e5b..919218e93e3bd301d3bd59bf93a2dcd6d1d61538 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
@@ -168,12 +168,6 @@ class int {
static int parse(String source, {int radix, int onError(String source)}) {
return Primitives.parseInt(source, radix, onError);
}
-
- @patch
- factory int.fromEnvironment(String name, {int defaultValue}) {
- throw new UnsupportedError(
- 'int.fromEnvironment can only be used as a const constructor');
- }
}
@patch
@@ -414,12 +408,6 @@ class String {
return Primitives.stringFromCharCode(charCode);
}
- @patch
- factory String.fromEnvironment(String name, {String defaultValue}) {
- throw new UnsupportedError(
- 'String.fromEnvironment can only be used as a const constructor');
- }
-
static String _stringFromJSArray(List list, int start, int endOrNull) {
int len = list.length;
int end = RangeError.checkValidRange(start, endOrNull, len);
@@ -466,12 +454,6 @@ class String {
@patch
class bool {
@patch
- factory bool.fromEnvironment(String name, {bool defaultValue: false}) {
- throw new UnsupportedError(
- 'bool.fromEnvironment can only be used as a const constructor');
- }
-
- @patch
int get hashCode => super.hashCode;
}

Powered by Google App Engine
This is Rietveld 408576698