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

Unified Diff: sdk/lib/_internal/compiler/implementation/native_handler.dart

Issue 11308257: - Parse the return type of JS during resolution to know what can be instantiated there. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years 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/native_handler.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/native_handler.dart (revision 15636)
+++ sdk/lib/_internal/compiler/implementation/native_handler.dart (working copy)
@@ -290,9 +290,24 @@
for (var type in behavior.typesInstantiated) {
if (matchedTypeConstraints.contains(type)) continue;
matchedTypeConstraints.add(type);
- if (type is SpecialType) {
- // The two special types (=Object, =List) are always instantiated.
- continue;
+ if (type == SpecialType.JsArray) {
+ world.registerInstantiatedClass(compiler.listClass);
+ } else if (type == SpecialType.JsObject) {
+ world.registerInstantiatedClass(compiler.objectClass);
+ } else if (type is InterfaceType) {
+ if (type.element == compiler.intClass) {
+ world.registerInstantiatedClass(compiler.intClass);
+ } else if (type.element == compiler.doubleClass) {
+ world.registerInstantiatedClass(compiler.doubleClass);
+ } else if (type.element == compiler.numClass) {
+ world.registerInstantiatedClass(compiler.numClass);
+ } else if (type.element == compiler.stringClass) {
+ world.registerInstantiatedClass(compiler.stringClass);
+ } else if (type.element == compiler.nullClass) {
+ world.registerInstantiatedClass(compiler.nullClass);
+ } else if (type.element == compiler.boolClass) {
+ world.registerInstantiatedClass(compiler.boolClass);
+ }
}
assert(type is DartType);
enqueueUnusedClassesMatching(

Powered by Google App Engine
This is Rietveld 408576698