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 2334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2345 | 2345 |
2346 visitIf(If node) { | 2346 visitIf(If node) { |
2347 doInPromotionScope(node.condition.expression, () => visit(node.condition)); | 2347 doInPromotionScope(node.condition.expression, () => visit(node.condition)); |
2348 doInPromotionScope(node.thenPart, | 2348 doInPromotionScope(node.thenPart, |
2349 () => visitIn(node.thenPart, new BlockScope(scope))); | 2349 () => visitIn(node.thenPart, new BlockScope(scope))); |
2350 visitIn(node.elsePart, new BlockScope(scope)); | 2350 visitIn(node.elsePart, new BlockScope(scope)); |
2351 } | 2351 } |
2352 | 2352 |
2353 ResolutionResult resolveSend(Send node) { | 2353 ResolutionResult resolveSend(Send node) { |
2354 Selector selector = resolveSelector(node, null); | 2354 Selector selector = resolveSelector(node, null); |
| 2355 if (selector != null) { |
| 2356 compiler.enqueuer.resolution.compilationInfo.registerCallSite( |
| 2357 registry.mapping, node); |
| 2358 } |
| 2359 |
2355 if (node.isSuperCall) registry.registerSuperUse(node); | 2360 if (node.isSuperCall) registry.registerSuperUse(node); |
2356 | 2361 |
2357 if (node.receiver == null) { | 2362 if (node.receiver == null) { |
2358 // If this send is of the form "assert(expr);", then | 2363 // If this send is of the form "assert(expr);", then |
2359 // this is an assertion. | 2364 // this is an assertion. |
2360 if (selector.isAssert) { | 2365 if (selector.isAssert) { |
2361 if (selector.argumentCount != 1) { | 2366 if (selector.argumentCount != 1) { |
2362 error(node.selector, | 2367 error(node.selector, |
2363 MessageKind.WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT, | 2368 MessageKind.WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT, |
2364 {'argumentCount': selector.argumentCount}); | 2369 {'argumentCount': selector.argumentCount}); |
(...skipping 2382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4747 } | 4752 } |
4748 | 4753 |
4749 /// The result for the resolution of the `assert` method. | 4754 /// The result for the resolution of the `assert` method. |
4750 class AssertResult implements ResolutionResult { | 4755 class AssertResult implements ResolutionResult { |
4751 const AssertResult(); | 4756 const AssertResult(); |
4752 | 4757 |
4753 Element get element => null; | 4758 Element get element => null; |
4754 | 4759 |
4755 String toString() => 'AssertResult()'; | 4760 String toString() => 'AssertResult()'; |
4756 } | 4761 } |
OLD | NEW |