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 operator[](Node node); | 8 Element operator[](Node node); |
9 Selector getSelector(Send send); | 9 Selector getSelector(Send send); |
10 DartType getType(Node node); | 10 DartType getType(Node node); |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 | 637 |
638 void resolveMetadataAnnotation(PartialMetadataAnnotation annotation) { | 638 void resolveMetadataAnnotation(PartialMetadataAnnotation annotation) { |
639 compiler.withCurrentElement(annotation.annotatedElement, () => measure(() { | 639 compiler.withCurrentElement(annotation.annotatedElement, () => measure(() { |
640 assert(annotation.resolutionState == STATE_NOT_STARTED); | 640 assert(annotation.resolutionState == STATE_NOT_STARTED); |
641 annotation.resolutionState = STATE_STARTED; | 641 annotation.resolutionState = STATE_STARTED; |
642 | 642 |
643 Node node = annotation.parseNode(compiler); | 643 Node node = annotation.parseNode(compiler); |
644 ResolverVisitor visitor = | 644 ResolverVisitor visitor = |
645 visitorFor(annotation.annotatedElement.enclosingElement); | 645 visitorFor(annotation.annotatedElement.enclosingElement); |
646 node.accept(visitor); | 646 node.accept(visitor); |
647 annotation.value = compiler.constantHandler.compileNodeWithDefinitions( | 647 annotation.value = compiler.metadataHandler.compileNodeWithDefinitions( |
648 node, visitor.mapping, isConst: true); | 648 node, visitor.mapping, isConst: true); |
649 | 649 |
650 annotation.resolutionState = STATE_DONE; | 650 annotation.resolutionState = STATE_DONE; |
651 })); | 651 })); |
652 } | 652 } |
653 | 653 |
654 error(Node node, MessageKind kind, [arguments = const []]) { | 654 error(Node node, MessageKind kind, [arguments = const []]) { |
655 ResolutionError message = new ResolutionError(kind, arguments); | 655 ResolutionError message = new ResolutionError(kind, arguments); |
656 compiler.reportError(node, message); | 656 compiler.reportError(node, message); |
657 } | 657 } |
(...skipping 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3171 return e; | 3171 return e; |
3172 } | 3172 } |
3173 | 3173 |
3174 /// Assumed to be called by [resolveRedirectingFactory]. | 3174 /// Assumed to be called by [resolveRedirectingFactory]. |
3175 Element visitReturn(Return node) { | 3175 Element visitReturn(Return node) { |
3176 Node expression = node.expression; | 3176 Node expression = node.expression; |
3177 return finishConstructorReference(visit(expression), | 3177 return finishConstructorReference(visit(expression), |
3178 expression, expression); | 3178 expression, expression); |
3179 } | 3179 } |
3180 } | 3180 } |
OLD | NEW |