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

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

Issue 10823293: Support resolution of indexed operators. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 name, 1311 name,
1312 node.argumentsNode is Prefix); 1312 node.argumentsNode is Prefix);
1313 } 1313 }
1314 Selector selector = mapping.getSelector(node); 1314 Selector selector = mapping.getSelector(node);
1315 if (Selector.GETTER === selector) { 1315 if (Selector.GETTER === selector) {
1316 world.registerDynamicGetter(name, selector); 1316 world.registerDynamicGetter(name, selector);
1317 } else if (Selector.SETTER === selector) { 1317 } else if (Selector.SETTER === selector) {
1318 world.registerDynamicSetter(name, selector); 1318 world.registerDynamicSetter(name, selector);
1319 // Also register the getter for compound assignments. 1319 // Also register the getter for compound assignments.
1320 world.registerDynamicGetter(name, Selector.GETTER); 1320 world.registerDynamicGetter(name, Selector.GETTER);
1321 } else if (Selector.INDEX_AND_INDEX_SET === selector) {
1322 register(op, selector) {
1323 world.registerDynamicInvocation(Elements.constructOperatorName(
1324 const SourceString('operator'), new SourceString(op)), selector);
1325 }
1326 register('[]', Selector.INDEX);
1327 register('[]=', Selector.INDEX_SET);
1321 } else { 1328 } else {
1322 world.registerDynamicInvocation(name, selector); 1329 world.registerDynamicInvocation(name, selector);
1323 } 1330 }
1324 var interceptor = new Interceptors(compiler).getStaticInterceptor( 1331 var interceptor = new Interceptors(compiler).getStaticInterceptor(
1325 name, 1332 name,
1326 node.argumentCount()); 1333 node.argumentCount());
1327 if (interceptor !== null) { 1334 if (interceptor !== null) {
1328 world.registerStaticUse(interceptor); 1335 world.registerStaticUse(interceptor);
1329 } 1336 }
1330 } 1337 }
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
2401 TopScope(LibraryElement library) : super(null, library); 2408 TopScope(LibraryElement library) : super(null, library);
2402 Element lookup(SourceString name) { 2409 Element lookup(SourceString name) {
2403 return library.find(name); 2410 return library.find(name);
2404 } 2411 }
2405 2412
2406 Element add(Element newElement) { 2413 Element add(Element newElement) {
2407 throw "Cannot add an element in the top scope"; 2414 throw "Cannot add an element in the top scope";
2408 } 2415 }
2409 String toString() => '$element'; 2416 String toString() => '$element';
2410 } 2417 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698