OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 elements.modelx; | 5 library elements.modelx; |
6 | 6 |
7 import '../common/resolution.dart' show | 7 import '../common/resolution.dart' show |
8 Resolution, | 8 Resolution, |
9 Parsing; | 9 Parsing; |
10 import '../compiler.dart' show | 10 import '../compiler.dart' show |
(...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2196 void set effectiveTarget(ConstructorElement constructor) { | 2196 void set effectiveTarget(ConstructorElement constructor) { |
2197 assert(constructor != null && internalEffectiveTarget == null); | 2197 assert(constructor != null && internalEffectiveTarget == null); |
2198 internalEffectiveTarget = constructor; | 2198 internalEffectiveTarget = constructor; |
2199 } | 2199 } |
2200 | 2200 |
2201 ConstructorElement get effectiveTarget { | 2201 ConstructorElement get effectiveTarget { |
2202 if (Elements.isErroneous(immediateRedirectionTarget)) { | 2202 if (Elements.isErroneous(immediateRedirectionTarget)) { |
2203 return immediateRedirectionTarget; | 2203 return immediateRedirectionTarget; |
2204 } | 2204 } |
2205 assert(!isRedirectingFactory || internalEffectiveTarget != null); | 2205 assert(!isRedirectingFactory || internalEffectiveTarget != null); |
2206 return isRedirectingFactory ? internalEffectiveTarget : this; | 2206 if (isRedirectingFactory) return internalEffectiveTarget; |
2207 if (isPatched) { | |
Johnni Winther
2015/10/06 10:38:14
Why is this needed?
Harry Terkelsen
2015/10/12 18:17:44
There are targets that are patched but are not red
| |
2208 return internalEffectiveTarget ?? this; | |
2209 } | |
2210 return this; | |
2207 } | 2211 } |
2208 | 2212 |
2209 InterfaceType computeEffectiveTargetType(InterfaceType newType) { | 2213 InterfaceType computeEffectiveTargetType(InterfaceType newType) { |
2210 if (!isRedirectingFactory) return newType; | 2214 if (!isRedirectingFactory) return newType; |
2211 assert(invariant(this, effectiveTargetType != null, | 2215 assert(invariant(this, effectiveTargetType != null, |
2212 message: 'Redirection target type has not yet been computed for ' | 2216 message: 'Redirection target type has not yet been computed for ' |
2213 '$this.')); | 2217 '$this.')); |
2214 return effectiveTargetType.substByContext(newType); | 2218 return effectiveTargetType.substByContext(newType); |
2215 } | 2219 } |
2216 | 2220 |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3103 AstElement get definingElement; | 3107 AstElement get definingElement; |
3104 | 3108 |
3105 bool get hasResolvedAst => definingElement.hasTreeElements; | 3109 bool get hasResolvedAst => definingElement.hasTreeElements; |
3106 | 3110 |
3107 ResolvedAst get resolvedAst { | 3111 ResolvedAst get resolvedAst { |
3108 return new ResolvedAst(declaration, | 3112 return new ResolvedAst(declaration, |
3109 definingElement.node, definingElement.treeElements); | 3113 definingElement.node, definingElement.treeElements); |
3110 } | 3114 } |
3111 | 3115 |
3112 } | 3116 } |
OLD | NEW |