OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 class InitializerResolver { | 7 class InitializerResolver { |
8 final ResolverVisitor visitor; | 8 final ResolverVisitor visitor; |
9 final Map<Element, Node> initialized; | 9 final Map<Element, Node> initialized; |
10 Link<Node> initializers; | 10 Link<Node> initializers; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 return calledConstructor; | 134 return calledConstructor; |
135 } | 135 } |
136 | 136 |
137 void resolveImplicitSuperConstructorSend(FunctionElement constructor, | 137 void resolveImplicitSuperConstructorSend(FunctionElement constructor, |
138 FunctionExpression functionNode) { | 138 FunctionExpression functionNode) { |
139 // If the class has a super resolve the implicit super call. | 139 // If the class has a super resolve the implicit super call. |
140 ClassElement classElement = constructor.enclosingClass; | 140 ClassElement classElement = constructor.enclosingClass; |
141 ClassElement superClass = classElement.superclass; | 141 ClassElement superClass = classElement.superclass; |
142 if (classElement != visitor.compiler.objectClass) { | 142 if (classElement != visitor.compiler.objectClass) { |
143 assert(superClass != null); | 143 assert(superClass != null); |
144 assert(superClass.resolutionState == STATE_DONE); | 144 assert(superClass.isResolved); |
145 | 145 |
146 final bool isSuperCall = true; | 146 final bool isSuperCall = true; |
147 ClassElement lookupTarget = getSuperOrThisLookupTarget(constructor, | 147 ClassElement lookupTarget = getSuperOrThisLookupTarget(constructor, |
148 isSuperCall, | 148 isSuperCall, |
149 functionNode); | 149 functionNode); |
150 Selector constructorSelector = new Selector.callDefaultConstructor(); | 150 Selector constructorSelector = new Selector.callDefaultConstructor(); |
151 Element calledConstructor = lookupTarget.lookupConstructor( | 151 Element calledConstructor = lookupTarget.lookupConstructor( |
152 constructorSelector.name); | 152 constructorSelector.name); |
153 | 153 |
154 final String className = lookupTarget.name; | 154 final String className = lookupTarget.name; |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 return element; | 469 return element; |
470 } | 470 } |
471 | 471 |
472 /// Assumed to be called by [resolveRedirectingFactory]. | 472 /// Assumed to be called by [resolveRedirectingFactory]. |
473 Element visitRedirectingFactoryBody(RedirectingFactoryBody node) { | 473 Element visitRedirectingFactoryBody(RedirectingFactoryBody node) { |
474 Node constructorReference = node.constructorReference; | 474 Node constructorReference = node.constructorReference; |
475 return finishConstructorReference(visit(constructorReference), | 475 return finishConstructorReference(visit(constructorReference), |
476 constructorReference, node); | 476 constructorReference, node); |
477 } | 477 } |
478 } | 478 } |
OLD | NEW |