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 Element get currentElement; | 8 Element get currentElement; |
9 Setlet<Node> get superUses; | 9 Setlet<Node> get superUses; |
10 | 10 |
(...skipping 3132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3143 {'value': name}); | 3143 {'value': name}); |
3144 } | 3144 } |
3145 return false; | 3145 return false; |
3146 } | 3146 } |
3147 return true; | 3147 return true; |
3148 } | 3148 } |
3149 | 3149 |
3150 /** | 3150 /** |
3151 * Try to resolve the constructor that is referred to by [node]. | 3151 * Try to resolve the constructor that is referred to by [node]. |
3152 * Note: this function may return an ErroneousFunctionElement instead of | 3152 * Note: this function may return an ErroneousFunctionElement instead of |
3153 * [null], if there is no corresponding constructor, class or library. | 3153 * [:null:], if there is no corresponding constructor, class or library. |
3154 */ | 3154 */ |
3155 FunctionElement resolveConstructor(NewExpression node) { | 3155 FunctionElement resolveConstructor(NewExpression node) { |
3156 return node.accept(new ConstructorResolver(compiler, this)); | 3156 return node.accept(new ConstructorResolver(compiler, this)); |
3157 } | 3157 } |
3158 | 3158 |
3159 FunctionElement resolveRedirectingFactory(Return node, | 3159 FunctionElement resolveRedirectingFactory(Return node, |
3160 {bool inConstContext: false}) { | 3160 {bool inConstContext: false}) { |
3161 return node.accept(new ConstructorResolver(compiler, this, | 3161 return node.accept(new ConstructorResolver(compiler, this, |
3162 inConstContext: inConstContext)); | 3162 inConstContext: inConstContext)); |
3163 } | 3163 } |
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4777 return finishConstructorReference(visit(expression), | 4777 return finishConstructorReference(visit(expression), |
4778 expression, expression); | 4778 expression, expression); |
4779 } | 4779 } |
4780 } | 4780 } |
4781 | 4781 |
4782 /// Looks up [name] in [scope] and unwraps the result. | 4782 /// Looks up [name] in [scope] and unwraps the result. |
4783 Element lookupInScope(Compiler compiler, Node node, | 4783 Element lookupInScope(Compiler compiler, Node node, |
4784 Scope scope, String name) { | 4784 Scope scope, String name) { |
4785 return Elements.unwrap(scope.lookup(name), compiler, node); | 4785 return Elements.unwrap(scope.lookup(name), compiler, node); |
4786 } | 4786 } |
OLD | NEW |