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

Side by Side 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: Remove unused variable. Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 abstract class TreeElements { 5 abstract class TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 DartType getType(Node node); 8 DartType getType(Node node);
9 bool isParameterChecked(Element element); 9 bool isParameterChecked(Element element);
10 } 10 }
(...skipping 2060 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 mapping[node.target] = label; 2071 mapping[node.target] = label;
2072 } 2072 }
2073 mapping[node] = target; 2073 mapping[node] = target;
2074 } 2074 }
2075 2075
2076 registerImplicitInvocation(SourceString name, int arity) { 2076 registerImplicitInvocation(SourceString name, int arity) {
2077 Selector selector = new Selector.call(name, null, arity); 2077 Selector selector = new Selector.call(name, null, arity);
2078 world.registerDynamicInvocation(name, selector); 2078 world.registerDynamicInvocation(name, selector);
2079 } 2079 }
2080 2080
2081 registerImplicitFieldGet(SourceString name) {
2082 Selector selector = new Selector.getter(name, null);
2083 world.registerDynamicGetter(name, selector);
2084 }
2085
2081 visitForIn(ForIn node) { 2086 visitForIn(ForIn node) {
2082 for (final name in const [ 2087 for (final name in const [
2083 const SourceString('iterator'), 2088 const SourceString('iterator'),
2084 const SourceString('next'), 2089 const SourceString('next')]) {
2085 const SourceString('hasNext')]) {
2086 registerImplicitInvocation(name, 0); 2090 registerImplicitInvocation(name, 0);
2087 } 2091 }
2092 registerImplicitFieldGet(const SourceString('hasNext'));
2088 visit(node.expression); 2093 visit(node.expression);
2089 Scope blockScope = new BlockScope(scope); 2094 Scope blockScope = new BlockScope(scope);
2090 Node declaration = node.declaredIdentifier; 2095 Node declaration = node.declaredIdentifier;
2091 visitIn(declaration, blockScope); 2096 visitIn(declaration, blockScope);
2092 visitLoopBodyIn(node, node.body, blockScope); 2097 visitLoopBodyIn(node, node.body, blockScope);
2093 2098
2094 // TODO(lrn): Also allow a single identifier. 2099 // TODO(lrn): Also allow a single identifier.
2095 if ((declaration is !Send || declaration.asSend().selector is !Identifier 2100 if ((declaration is !Send || declaration.asSend().selector is !Identifier
2096 || declaration.asSend().receiver != null) 2101 || declaration.asSend().receiver != null)
2097 && (declaration is !VariableDefinitions || 2102 && (declaration is !VariableDefinitions ||
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
3190 return result; 3195 return result;
3191 } 3196 }
3192 Element lookup(SourceString name) => localLookup(name); 3197 Element lookup(SourceString name) => localLookup(name);
3193 Element lexicalLookup(SourceString name) => localLookup(name); 3198 Element lexicalLookup(SourceString name) => localLookup(name);
3194 3199
3195 Element add(Element newElement) { 3200 Element add(Element newElement) {
3196 throw "Cannot add an element in a patch library scope"; 3201 throw "Cannot add an element in a patch library scope";
3197 } 3202 }
3198 String toString() => 'PatchLibraryScope($origin,$patch)'; 3203 String toString() => 'PatchLibraryScope($origin,$patch)';
3199 } 3204 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/lib/string_helper.dart ('k') | lib/compiler/implementation/scanner/byte_strings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698