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

Unified Diff: sdk/lib/_internal/compiler/implementation/compiler.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/compiler/implementation/compiler.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/compiler.dart (revision 29652)
+++ sdk/lib/_internal/compiler/implementation/compiler.dart (working copy)
@@ -473,7 +473,12 @@
Element identicalFunction;
Element functionApplyMethod;
Element invokeOnMethod;
+ Element intEnvironment;
+ Element boolEnvironment;
+ Element stringEnvironment;
+ fromEnvironment(String name) => null;
+
Element get currentElement => _currentElement;
String tryToString(object) {
@@ -571,6 +576,8 @@
Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT);
final Selector symbolValidatedConstructorSelector = new Selector.call(
'validated', null, 1);
+ final Selector fromEnvironmentSelector = new Selector.callConstructor(
+ 'fromEnvironment', null, 2);
bool enabledNoSuchMethod = false;
bool enabledRuntimeType = false;
@@ -852,6 +859,13 @@
symbolValidatedConstructorSelector);
} else if (mirrorsUsedClass == cls) {
mirrorsUsedConstructor = cls.constructors.head;
+ } else if (intClass == cls) {
+ intEnvironment = intClass.lookupConstructor(fromEnvironmentSelector);
+ } else if (stringClass == cls) {
+ stringEnvironment =
+ stringClass.lookupConstructor(fromEnvironmentSelector);
+ } else if (boolClass == cls) {
+ boolEnvironment = boolClass.lookupConstructor(fromEnvironmentSelector);
}
}

Powered by Google App Engine
This is Rietveld 408576698