| 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 | 10 import '../common/names.dart' show |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return const ResolutionImpact(); | 80 return const ResolutionImpact(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 WorldImpact processMetadata([WorldImpact result]) { | 83 WorldImpact processMetadata([WorldImpact result]) { |
| 84 for (MetadataAnnotation metadata in element.implementation.metadata) { | 84 for (MetadataAnnotation metadata in element.implementation.metadata) { |
| 85 metadata.ensureResolved(resolution); | 85 metadata.ensureResolved(resolution); |
| 86 } | 86 } |
| 87 return result; | 87 return result; |
| 88 } | 88 } |
| 89 | 89 |
| 90 ElementKind kind = element.kind; | 90 if (element.isConstructor || |
| 91 if (identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR) || | 91 element.isFunction || |
| 92 identical(kind, ElementKind.FUNCTION) || | 92 element.isGetter || |
| 93 identical(kind, ElementKind.GETTER) || | 93 element.isSetter) { |
| 94 identical(kind, ElementKind.SETTER)) { | |
| 95 return processMetadata(resolveMethodElement(element)); | 94 return processMetadata(resolveMethodElement(element)); |
| 96 } | 95 } |
| 97 | 96 |
| 98 if (identical(kind, ElementKind.FIELD)) { | 97 if (element.isField) { |
| 99 return processMetadata(resolveField(element)); | 98 return processMetadata(resolveField(element)); |
| 100 } | 99 } |
| 101 if (element.isClass) { | 100 if (element.isClass) { |
| 102 ClassElement cls = element; | 101 ClassElement cls = element; |
| 103 cls.ensureResolved(resolution); | 102 cls.ensureResolved(resolution); |
| 104 return processMetadata(const ResolutionImpact()); | 103 return processMetadata(const ResolutionImpact()); |
| 105 } else if (element.isTypedef) { | 104 } else if (element.isTypedef) { |
| 106 TypedefElement typdef = element; | 105 TypedefElement typdef = element; |
| 107 return processMetadata(resolveTypedef(typdef)); | 106 return processMetadata(resolveTypedef(typdef)); |
| 108 } | 107 } |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 TreeElements get treeElements { | 1074 TreeElements get treeElements { |
| 1076 assert(invariant(this, _treeElements !=null, | 1075 assert(invariant(this, _treeElements !=null, |
| 1077 message: "TreeElements have not been computed for $this.")); | 1076 message: "TreeElements have not been computed for $this.")); |
| 1078 return _treeElements; | 1077 return _treeElements; |
| 1079 } | 1078 } |
| 1080 | 1079 |
| 1081 void reuseElement() { | 1080 void reuseElement() { |
| 1082 _treeElements = null; | 1081 _treeElements = null; |
| 1083 } | 1082 } |
| 1084 } | 1083 } |
| OLD | NEW |