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

Unified Diff: sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.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/inferrer/type_graph_nodes.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.dart (revision 29652)
+++ sdk/lib/_internal/compiler/implementation/inferrer/type_graph_nodes.dart (working copy)
@@ -197,7 +197,7 @@
* return type.
*
* Note that a few elements of these kinds must be treated specially,
- * and they are dealt in [ElementTypeInformation.handleSpecialCase]:
+ * and they are dealt in [ElementTypeInformation.handleSpecialCases]:
*
* - Parameters of closures, [noSuchMethod] and [call] instance
* methods: we currently do not infer types for those.
@@ -298,6 +298,18 @@
}
}
}
+
+ Compiler compiler = inferrer.compiler;
+ if (element.declaration == compiler.intEnvironment) {
+ giveUp(inferrer);
+ return compiler.typesTask.intType.nullable();
+ } else if (element.declaration == compiler.boolEnvironment) {
+ giveUp(inferrer);
+ return compiler.typesTask.boolType.nullable();
+ } else if (element.declaration == compiler.stringEnvironment) {
+ giveUp(inferrer);
+ return compiler.typesTask.stringType.nullable();
+ }
return null;
}

Powered by Google App Engine
This is Rietveld 408576698