| 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 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1493 String constructorName = ''; | 1493 String constructorName = ''; |
| 1494 Selector callToMatch = new Selector.call( | 1494 Selector callToMatch = new Selector.call( |
| 1495 constructorName, | 1495 constructorName, |
| 1496 classElement.library, | 1496 classElement.library, |
| 1497 0); | 1497 0); |
| 1498 | 1498 |
| 1499 final bool isSuperCall = true; | 1499 final bool isSuperCall = true; |
| 1500 ClassElement lookupTarget = getSuperOrThisLookupTarget(constructor, | 1500 ClassElement lookupTarget = getSuperOrThisLookupTarget(constructor, |
| 1501 isSuperCall, | 1501 isSuperCall, |
| 1502 functionNode); | 1502 functionNode); |
| 1503 Selector constructorSelector = new Selector.callDefaultConstructor( | 1503 Selector constructorSelector = new Selector.callDefaultConstructor(); |
| 1504 visitor.enclosingElement.library); | |
| 1505 Element calledConstructor = lookupTarget.lookupConstructor( | 1504 Element calledConstructor = lookupTarget.lookupConstructor( |
| 1506 constructorSelector.name); | 1505 constructorSelector.name); |
| 1507 | 1506 |
| 1508 final String className = lookupTarget.name; | 1507 final String className = lookupTarget.name; |
| 1509 final bool isImplicitSuperCall = true; | 1508 final bool isImplicitSuperCall = true; |
| 1510 verifyThatConstructorMatchesCall(constructor, | 1509 verifyThatConstructorMatchesCall(constructor, |
| 1511 calledConstructor, | 1510 calledConstructor, |
| 1512 callToMatch, | 1511 callToMatch, |
| 1513 isImplicitSuperCall, | 1512 isImplicitSuperCall, |
| 1514 functionNode, | 1513 functionNode, |
| (...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2309 | 2308 |
| 2310 bool isNamedConstructor(Send node) => node.receiver != null; | 2309 bool isNamedConstructor(Send node) => node.receiver != null; |
| 2311 | 2310 |
| 2312 Selector getRedirectingThisOrSuperConstructorSelector(Send node) { | 2311 Selector getRedirectingThisOrSuperConstructorSelector(Send node) { |
| 2313 if (isNamedConstructor(node)) { | 2312 if (isNamedConstructor(node)) { |
| 2314 String constructorName = node.selector.asIdentifier().source; | 2313 String constructorName = node.selector.asIdentifier().source; |
| 2315 return new Selector.callConstructor( | 2314 return new Selector.callConstructor( |
| 2316 constructorName, | 2315 constructorName, |
| 2317 enclosingElement.library); | 2316 enclosingElement.library); |
| 2318 } else { | 2317 } else { |
| 2319 return new Selector.callDefaultConstructor( | 2318 return new Selector.callDefaultConstructor(); |
| 2320 enclosingElement.library); | |
| 2321 } | 2319 } |
| 2322 } | 2320 } |
| 2323 | 2321 |
| 2324 FunctionElement resolveConstructorRedirection(FunctionElementX constructor) { | 2322 FunctionElement resolveConstructorRedirection(FunctionElementX constructor) { |
| 2325 FunctionExpression node = constructor.parseNode(compiler); | 2323 FunctionExpression node = constructor.parseNode(compiler); |
| 2326 | 2324 |
| 2327 // A synthetic constructor does not have a node. | 2325 // A synthetic constructor does not have a node. |
| 2328 if (node == null) return null; | 2326 if (node == null) return null; |
| 2329 if (node.initializers == null) return null; | 2327 if (node.initializers == null) return null; |
| 2330 Link<Node> initializers = node.initializers.nodes; | 2328 Link<Node> initializers = node.initializers.nodes; |
| (...skipping 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5033 } | 5031 } |
| 5034 | 5032 |
| 5035 /// The result for the resolution of the `assert` method. | 5033 /// The result for the resolution of the `assert` method. |
| 5036 class AssertResult implements ResolutionResult { | 5034 class AssertResult implements ResolutionResult { |
| 5037 const AssertResult(); | 5035 const AssertResult(); |
| 5038 | 5036 |
| 5039 Element get element => null; | 5037 Element get element => null; |
| 5040 | 5038 |
| 5041 String toString() => 'AssertResult()'; | 5039 String toString() => 'AssertResult()'; |
| 5042 } | 5040 } |
| OLD | NEW |