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

Side by Side Diff: lib/compiler/implementation/resolver.dart

Issue 10834270: Implement call operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Simplify nested loop and add TODO.p Created 8 years, 4 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 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 interface TreeElements { 5 interface TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 Type getType(TypeAnnotation annotation); 8 Type getType(TypeAnnotation annotation);
9 } 9 }
10 10
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 mapping.setSelector(node, Selector.INDEX); 1188 mapping.setSelector(node, Selector.INDEX);
1189 } else if (node.isPropertyAccess) { 1189 } else if (node.isPropertyAccess) {
1190 mapping.setSelector(node, Selector.GETTER); 1190 mapping.setSelector(node, Selector.GETTER);
1191 } else { 1191 } else {
1192 handleArguments(node); 1192 handleArguments(node);
1193 } 1193 }
1194 if (target != null && target.kind == ElementKind.ABSTRACT_FIELD) { 1194 if (target != null && target.kind == ElementKind.ABSTRACT_FIELD) {
1195 AbstractFieldElement field = target; 1195 AbstractFieldElement field = target;
1196 target = field.getter; 1196 target = field.getter;
1197 } 1197 }
1198 if (node.isCall &&
1199 (target === null ||
1200 target.isGetter() ||
1201 Elements.isClosureSend(node, target))) {
1202 world.registerDynamicInvocation(compiler.namer.CLOSURE_INVOCATION_NAME,
1203 mapping.getSelector(node));
1204 }
1198 // TODO(ngeoffray): We should do the check in 1205 // TODO(ngeoffray): We should do the check in
1199 // visitExpressionStatement instead. 1206 // visitExpressionStatement instead.
1200 if (target === compiler.assertMethod && !node.isCall) { 1207 if (target === compiler.assertMethod && !node.isCall) {
1201 // We can only use assert by calling it. 1208 // We can only use assert by calling it.
1202 if (!inInstanceContext) { 1209 if (!inInstanceContext) {
1203 error(node, MessageKind.MISSING_ARGUMENTS_TO_ASSERT, [node]); 1210 error(node, MessageKind.MISSING_ARGUMENTS_TO_ASSERT, [node]);
1204 } 1211 }
1205 target = null; 1212 target = null;
1206 } 1213 }
1207 // TODO(ngeoffray): Warn if target is null and the send is 1214 // TODO(ngeoffray): Warn if target is null and the send is
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
2303 TopScope(LibraryElement library) : super(null, library); 2310 TopScope(LibraryElement library) : super(null, library);
2304 Element lookup(SourceString name) { 2311 Element lookup(SourceString name) {
2305 return library.find(name); 2312 return library.find(name);
2306 } 2313 }
2307 2314
2308 Element add(Element newElement) { 2315 Element add(Element newElement) {
2309 throw "Cannot add an element in the top scope"; 2316 throw "Cannot add an element in the top scope";
2310 } 2317 }
2311 String toString() => '$element'; 2318 String toString() => '$element';
2312 } 2319 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/resolved_visitor.dart ('k') | lib/compiler/implementation/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698