OLD | NEW |
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 part of resolution; | 5 part of resolution; |
6 | 6 |
7 abstract class TreeElements { | 7 abstract class TreeElements { |
8 Element get currentElement; | 8 Element get currentElement; |
9 Setlet<Node> get superUses; | 9 Setlet<Node> get superUses; |
10 | 10 |
(...skipping 2423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2434 | 2434 |
2435 visitIf(If node) { | 2435 visitIf(If node) { |
2436 doInPromotionScope(node.condition.expression, () => visit(node.condition)); | 2436 doInPromotionScope(node.condition.expression, () => visit(node.condition)); |
2437 doInPromotionScope(node.thenPart, | 2437 doInPromotionScope(node.thenPart, |
2438 () => visitIn(node.thenPart, new BlockScope(scope))); | 2438 () => visitIn(node.thenPart, new BlockScope(scope))); |
2439 visitIn(node.elsePart, new BlockScope(scope)); | 2439 visitIn(node.elsePart, new BlockScope(scope)); |
2440 } | 2440 } |
2441 | 2441 |
2442 ResolutionResult resolveSend(Send node) { | 2442 ResolutionResult resolveSend(Send node) { |
2443 Selector selector = resolveSelector(node, null); | 2443 Selector selector = resolveSelector(node, null); |
2444 if (selector != null) { | |
2445 compiler.enqueuer.resolution.compilationInfo.registerCallSite( | |
2446 registry.mapping, node); | |
2447 } | |
2448 | |
2449 if (node.isSuperCall) registry.registerSuperUse(node); | 2444 if (node.isSuperCall) registry.registerSuperUse(node); |
2450 | 2445 |
2451 if (node.receiver == null) { | 2446 if (node.receiver == null) { |
2452 // If this send is of the form "assert(expr);", then | 2447 // If this send is of the form "assert(expr);", then |
2453 // this is an assertion. | 2448 // this is an assertion. |
2454 if (selector.isAssert) { | 2449 if (selector.isAssert) { |
2455 if (selector.argumentCount != 1) { | 2450 if (selector.argumentCount != 1) { |
2456 error(node.selector, | 2451 error(node.selector, |
2457 MessageKind.WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT, | 2452 MessageKind.WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT, |
2458 {'argumentCount': selector.argumentCount}); | 2453 {'argumentCount': selector.argumentCount}); |
(...skipping 2374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4833 } | 4828 } |
4834 | 4829 |
4835 /// The result for the resolution of the `assert` method. | 4830 /// The result for the resolution of the `assert` method. |
4836 class AssertResult implements ResolutionResult { | 4831 class AssertResult implements ResolutionResult { |
4837 const AssertResult(); | 4832 const AssertResult(); |
4838 | 4833 |
4839 Element get element => null; | 4834 Element get element => null; |
4840 | 4835 |
4841 String toString() => 'AssertResult()'; | 4836 String toString() => 'AssertResult()'; |
4842 } | 4837 } |
OLD | NEW |