| 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 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 3209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3220 compiler.reportError( | 3220 compiler.reportError( |
| 3221 node, MessageKind.FACTORY_REDIRECTION_IN_NON_FACTORY); | 3221 node, MessageKind.FACTORY_REDIRECTION_IN_NON_FACTORY); |
| 3222 compiler.reportHint( | 3222 compiler.reportHint( |
| 3223 enclosingElement, MessageKind.MISSING_FACTORY_KEYWORD); | 3223 enclosingElement, MessageKind.MISSING_FACTORY_KEYWORD); |
| 3224 } | 3224 } |
| 3225 ConstructorElementX constructor = enclosingElement; | 3225 ConstructorElementX constructor = enclosingElement; |
| 3226 bool isConstConstructor = constructor.isConst; | 3226 bool isConstConstructor = constructor.isConst; |
| 3227 ConstructorElement redirectionTarget = resolveRedirectingFactory( | 3227 ConstructorElement redirectionTarget = resolveRedirectingFactory( |
| 3228 node, inConstContext: isConstConstructor); | 3228 node, inConstContext: isConstConstructor); |
| 3229 constructor.immediateRedirectionTarget = redirectionTarget; | 3229 constructor.immediateRedirectionTarget = redirectionTarget; |
| 3230 |
| 3231 Node constructorReference = node.constructorReference; |
| 3232 if (constructorReference is Send) { |
| 3233 constructor.redirectionDeferredPrefix = |
| 3234 compiler.deferredLoadTask.deferredPrefixElement(constructorReference, |
| 3235 registry.mapping); |
| 3236 } |
| 3237 |
| 3230 registry.setRedirectingTargetConstructor(node, redirectionTarget); | 3238 registry.setRedirectingTargetConstructor(node, redirectionTarget); |
| 3231 if (Elements.isUnresolved(redirectionTarget)) { | 3239 if (Elements.isUnresolved(redirectionTarget)) { |
| 3232 registry.registerThrowNoSuchMethod(); | 3240 registry.registerThrowNoSuchMethod(); |
| 3233 return; | 3241 return; |
| 3234 } else { | 3242 } else { |
| 3235 if (isConstConstructor && | 3243 if (isConstConstructor && |
| 3236 !redirectionTarget.isConst) { | 3244 !redirectionTarget.isConst) { |
| 3237 compiler.reportError(node, MessageKind.CONSTRUCTOR_IS_NOT_CONST); | 3245 compiler.reportError(node, MessageKind.CONSTRUCTOR_IS_NOT_CONST); |
| 3238 } | 3246 } |
| 3239 if (redirectionTarget == constructor) { | 3247 if (redirectionTarget == constructor) { |
| (...skipping 1908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5148 } | 5156 } |
| 5149 | 5157 |
| 5150 /// The result for the resolution of the `assert` method. | 5158 /// The result for the resolution of the `assert` method. |
| 5151 class AssertResult implements ResolutionResult { | 5159 class AssertResult implements ResolutionResult { |
| 5152 const AssertResult(); | 5160 const AssertResult(); |
| 5153 | 5161 |
| 5154 Element get element => null; | 5162 Element get element => null; |
| 5155 | 5163 |
| 5156 String toString() => 'AssertResult()'; | 5164 String toString() => 'AssertResult()'; |
| 5157 } | 5165 } |
| OLD | NEW |