OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 library dart2js.resolution_strategy; | 5 library dart2js.resolution_strategy; |
6 | 6 |
7 import 'package:front_end/src/fasta/scanner.dart' show Token; | 7 import 'package:front_end/src/fasta/scanner.dart' show Token; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common_elements.dart'; | 10 import '../common_elements.dart'; |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 metadata.ensureResolved(_compiler.resolution); | 671 metadata.ensureResolved(_compiler.resolution); |
672 assert(metadata.constant != null, | 672 assert(metadata.constant != null, |
673 failedAt(metadata, "Unevaluated metadata constant.")); | 673 failedAt(metadata, "Unevaluated metadata constant.")); |
674 ConstantValue value = | 674 ConstantValue value = |
675 _compiler.constants.getConstantValue(metadata.constant); | 675 _compiler.constants.getConstantValue(metadata.constant); |
676 values.add(value); | 676 values.add(value); |
677 } | 677 } |
678 }); | 678 }); |
679 return values; | 679 return values; |
680 } | 680 } |
| 681 |
| 682 @override |
| 683 ResolutionFunctionType getTypedefAlias(covariant TypedefElement typedef) { |
| 684 return typedef.alias; |
| 685 } |
681 } | 686 } |
682 | 687 |
683 /// AST-based logic for processing annotations. These annotations are processed | 688 /// AST-based logic for processing annotations. These annotations are processed |
684 /// very early in the compilation pipeline, typically this is before resolution | 689 /// very early in the compilation pipeline, typically this is before resolution |
685 /// is complete. Because of that this processor does a lightweight parse of the | 690 /// is complete. Because of that this processor does a lightweight parse of the |
686 /// annotation (which is restricted to a limited subset of the annotation | 691 /// annotation (which is restricted to a limited subset of the annotation |
687 /// syntax), and, once resolution completes, it validates that the parsed | 692 /// syntax), and, once resolution completes, it validates that the parsed |
688 /// annotations correspond to the correct element. | 693 /// annotations correspond to the correct element. |
689 class _ElementAnnotationProcessor implements AnnotationProcessor { | 694 class _ElementAnnotationProcessor implements AnnotationProcessor { |
690 final Compiler _compiler; | 695 final Compiler _compiler; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 @override | 886 @override |
882 WorkItem createWorkItem(MemberElement element) { | 887 WorkItem createWorkItem(MemberElement element) { |
883 assert(element.isDeclaration, failedAt(element)); | 888 assert(element.isDeclaration, failedAt(element)); |
884 if (element.isMalformed) return null; | 889 if (element.isMalformed) return null; |
885 | 890 |
886 assert(element is AnalyzableElement, | 891 assert(element is AnalyzableElement, |
887 failedAt(element, 'Element $element is not analyzable.')); | 892 failedAt(element, 'Element $element is not analyzable.')); |
888 return _resolution.createWorkItem(element); | 893 return _resolution.createWorkItem(element); |
889 } | 894 } |
890 } | 895 } |
OLD | NEW |