| 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 2642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2653 // we need to register that fact that we may be calling a closure | 2653 // we need to register that fact that we may be calling a closure |
| 2654 // with the same arguments. | 2654 // with the same arguments. |
| 2655 Selector call = new Selector.callClosureFrom(selector); | 2655 Selector call = new Selector.callClosureFrom(selector); |
| 2656 world.registerDynamicInvocation(call); | 2656 world.registerDynamicInvocation(call); |
| 2657 } else if (target.impliesType()) { | 2657 } else if (target.impliesType()) { |
| 2658 // We call 'call()' on a Type instance returned from the reference to a | 2658 // We call 'call()' on a Type instance returned from the reference to a |
| 2659 // class or typedef literal. We do not need to register this call as a | 2659 // class or typedef literal. We do not need to register this call as a |
| 2660 // dynamic invocation, because we statically know what the target is. | 2660 // dynamic invocation, because we statically know what the target is. |
| 2661 } else if (!selector.applies(target, compiler)) { | 2661 } else if (!selector.applies(target, compiler)) { |
| 2662 warnArgumentMismatch(node, target); | 2662 warnArgumentMismatch(node, target); |
| 2663 if (node.isSuperCall) { |
| 2664 // Similar to what we do when we can't find super via selector |
| 2665 // in [resolveSend] above, we still need to register the invocation, |
| 2666 // because we might call [:super.noSuchMethod:] which calls |
| 2667 // [JSInvocationMirror._invokeOn]. |
| 2668 world.registerDynamicInvocation(selector); |
| 2669 compiler.backend.registerSuperNoSuchMethod(mapping); |
| 2670 } |
| 2663 } | 2671 } |
| 2664 | 2672 |
| 2665 if (target != null && target.isForeign(compiler)) { | 2673 if (target != null && target.isForeign(compiler)) { |
| 2666 if (selector.name == 'JS') { | 2674 if (selector.name == 'JS') { |
| 2667 world.registerJsCall(node, this); | 2675 world.registerJsCall(node, this); |
| 2668 } else if (selector.name == 'JS_INTERCEPTOR_CONSTANT') { | 2676 } else if (selector.name == 'JS_INTERCEPTOR_CONSTANT') { |
| 2669 if (!node.argumentsNode.isEmpty) { | 2677 if (!node.argumentsNode.isEmpty) { |
| 2670 Node argument = node.argumentsNode.nodes.head; | 2678 Node argument = node.argumentsNode.nodes.head; |
| 2671 if (argumentsToJsInterceptorConstant == null) { | 2679 if (argumentsToJsInterceptorConstant == null) { |
| 2672 argumentsToJsInterceptorConstant = new Set<Node>(); | 2680 argumentsToJsInterceptorConstant = new Set<Node>(); |
| (...skipping 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4740 return finishConstructorReference(visit(expression), | 4748 return finishConstructorReference(visit(expression), |
| 4741 expression, expression); | 4749 expression, expression); |
| 4742 } | 4750 } |
| 4743 } | 4751 } |
| 4744 | 4752 |
| 4745 /// Looks up [name] in [scope] and unwraps the result. | 4753 /// Looks up [name] in [scope] and unwraps the result. |
| 4746 Element lookupInScope(Compiler compiler, Node node, | 4754 Element lookupInScope(Compiler compiler, Node node, |
| 4747 Scope scope, String name) { | 4755 Scope scope, String name) { |
| 4748 return Elements.unwrap(scope.lookup(name), compiler, node); | 4756 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4749 } | 4757 } |
| OLD | NEW |