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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1051223003: dartj2s: add constructor helpers for map literals with no type parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added comment. Created 5 years, 8 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index 94c62a45a1e2c2764232f6a9eef50b5cc54cf5f5..529a254e929df6c7d258f664ad583a00dcb5a574 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -311,6 +311,8 @@ class JavaScriptBackend extends Backend {
ClassElement typeVariableClass;
ConstructorElement mapLiteralConstructor;
ConstructorElement mapLiteralConstructorEmpty;
+ Element mapLiteralUntypedMaker;
+ Element mapLiteralUntypedEmptyMaker;
ClassElement noSideEffectsClass;
ClassElement noThrowsClass;
@@ -1016,10 +1018,27 @@ class JavaScriptBackend extends Backend {
}
return ctor;
}
+ Element getMember(String name) {
+ // The constructor is on the patch class, but dart2js unit tests don't
+ // have a patch class.
+ ClassElement implementation = cls.patch != null ? cls.patch : cls;
+ Element element = implementation.lookupLocalMember(name);
+ if (element == null || !element.isFunction || !element.isStatic) {
+ compiler.internalError(mapLiteralClass,
+ "Map literal class $mapLiteralClass missing "
+ "'$name' static member function");
+ }
+ return element;
+ }
mapLiteralConstructor = getFactory('_literal', 1);
mapLiteralConstructorEmpty = getFactory('_empty', 0);
enqueueInResolution(mapLiteralConstructor, registry);
enqueueInResolution(mapLiteralConstructorEmpty, registry);
+
+ mapLiteralUntypedMaker = getMember('_makeLiteral');
+ mapLiteralUntypedEmptyMaker = getMember('_makeEmpty');
+ enqueueInResolution(mapLiteralUntypedMaker, registry);
+ enqueueInResolution(mapLiteralUntypedEmptyMaker, registry);
}
}
if (cls == closureClass) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698