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

Unified Diff: lib/compiler/implementation/resolution/members.dart

Issue 11230011: Make hasNext a getter instead of a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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: lib/compiler/implementation/resolution/members.dart
diff --git a/lib/compiler/implementation/resolution/members.dart b/lib/compiler/implementation/resolution/members.dart
index 866efe95366efc1b23c566e780e892682de2a165..6ef72562ab1f045ed28ca40bc67c19169f53fe19 100644
--- a/lib/compiler/implementation/resolution/members.dart
+++ b/lib/compiler/implementation/resolution/members.dart
@@ -2078,13 +2078,18 @@ class ResolverVisitor extends CommonResolverVisitor<Element> {
world.registerDynamicInvocation(name, selector);
}
+ registerImplicitFieldGet(SourceString name) {
+ Selector selector = new Selector.getter(name, null);
+ world.registerDynamicGetter(name, selector);
+ }
+
visitForIn(ForIn node) {
for (final name in const [
const SourceString('iterator'),
- const SourceString('next'),
- const SourceString('hasNext')]) {
+ const SourceString('next')]) {
registerImplicitInvocation(name, 0);
}
+ registerImplicitFieldGet(const SourceString('hasNext'));
visit(node.expression);
Scope blockScope = new BlockScope(scope);
Node declaration = node.declaredIdentifier;

Powered by Google App Engine
This is Rietveld 408576698