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

Unified Diff: lib/compiler/implementation/resolver.dart

Issue 10948036: Register iterate-protocol helper if there is for-in. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/resolver.dart
diff --git a/lib/compiler/implementation/resolver.dart b/lib/compiler/implementation/resolver.dart
index 06f4b3fcc148b0531c57660a4d57940a20fb1ad7..4d48866514c95619f2f715eece5cae4ee62aa3b9 100644
--- a/lib/compiler/implementation/resolver.dart
+++ b/lib/compiler/implementation/resolver.dart
@@ -1751,10 +1751,7 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
}
visitStringInterpolationPart(StringInterpolationPart node) {
- SourceString name = const SourceString('toString');
- LibraryElement library = enclosingElement.getLibrary();
- Selector selector = new Selector.call(name, library, 0);
- world.registerDynamicInvocation(name, selector);
+ registerImplicitInvocation(const SourceString('toString'), 0);
node.visitChildren(this);
}
@@ -1815,7 +1812,18 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
mapping[node] = target;
}
+ registerImplicitInvocation(SourceString name, int arity) {
+ Selector selector = new Selector.call(name, null, arity);
+ world.registerDynamicInvocation(name, selector);
+ }
+
visitForIn(ForIn node) {
+ for (final name in const [
+ const SourceString('iterator'),
+ const SourceString('next'),
+ const SourceString('hasNext')]) {
+ registerImplicitInvocation(name, 0);
+ }
visit(node.expression);
Scope blockScope = new BlockScope(scope);
Node declaration = node.declaredIdentifier;
« no previous file with comments | « no previous file | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698