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 library dart2js.resolution; | 5 library dart2js.resolution; |
6 | 6 |
7 import 'dart:collection' show Queue; | 7 import 'dart:collection' show Queue; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common/names.dart' show Identifiers; | 10 import '../common/names.dart' show Identifiers; |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 constant = new ErroneousConstantExpression(); | 1081 constant = new ErroneousConstantExpression(); |
1082 break; | 1082 break; |
1083 } | 1083 } |
1084 annotation.constant = constant; | 1084 annotation.constant = constant; |
1085 | 1085 |
1086 constantCompiler.evaluate(annotation.constant); | 1086 constantCompiler.evaluate(annotation.constant); |
1087 // TODO(johnniwinther): Register the relation between the annotati
on | 1087 // TODO(johnniwinther): Register the relation between the annotati
on |
1088 // and the annotated element instead. This will allow the backend
to | 1088 // and the annotated element instead. This will allow the backend
to |
1089 // retrieve the backend constant and only register metadata on the | 1089 // retrieve the backend constant and only register metadata on the |
1090 // elements for which it is needed. (Issue 17732). | 1090 // elements for which it is needed. (Issue 17732). |
1091 registry.registerMetadataConstant(annotation); | |
1092 annotation.resolutionState = STATE_DONE; | 1091 annotation.resolutionState = STATE_DONE; |
1093 })); | 1092 })); |
1094 } | 1093 } |
1095 | 1094 |
1096 List<MetadataAnnotation> resolveMetadata( | 1095 List<MetadataAnnotation> resolveMetadata( |
1097 Element element, VariableDefinitions node) { | 1096 Element element, VariableDefinitions node) { |
1098 List<MetadataAnnotation> metadata = <MetadataAnnotation>[]; | 1097 List<MetadataAnnotation> metadata = <MetadataAnnotation>[]; |
1099 for (Metadata annotation in node.metadata.nodes) { | 1098 for (Metadata annotation in node.metadata.nodes) { |
1100 ParameterMetadataAnnotation metadataAnnotation = | 1099 ParameterMetadataAnnotation metadataAnnotation = |
1101 new ParameterMetadataAnnotation(annotation); | 1100 new ParameterMetadataAnnotation(annotation); |
(...skipping 19 matching lines...) Expand all Loading... |
1121 TreeElements get treeElements { | 1120 TreeElements get treeElements { |
1122 assert(invariant(this, _treeElements != null, | 1121 assert(invariant(this, _treeElements != null, |
1123 message: "TreeElements have not been computed for $this.")); | 1122 message: "TreeElements have not been computed for $this.")); |
1124 return _treeElements; | 1123 return _treeElements; |
1125 } | 1124 } |
1126 | 1125 |
1127 void reuseElement() { | 1126 void reuseElement() { |
1128 _treeElements = null; | 1127 _treeElements = null; |
1129 } | 1128 } |
1130 } | 1129 } |
OLD | NEW |