Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: pkg/compiler/lib/src/resolution/constructors.dart

Issue 1162603006: Element model cleanup + prepare for easier reimplementation. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/constant_emitter.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698