| 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 library dart2js.resolution.constructors; | 5 library dart2js.resolution.constructors; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show Feature; | 8 import '../common/resolution.dart' show Feature; |
| 9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
| 10 import '../constants/constructors.dart' | 10 import '../constants/constructors.dart' |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 | 164 |
| 165 bool isSuperCall = Initializers.isSuperConstructorCall(node); | 165 bool isSuperCall = Initializers.isSuperConstructorCall(node); |
| 166 InterfaceType targetType = | 166 InterfaceType targetType = |
| 167 getSuperOrThisLookupTarget(node, isSuperCall: isSuperCall); | 167 getSuperOrThisLookupTarget(node, isSuperCall: isSuperCall); |
| 168 ClassElement lookupTarget = targetType.element; | 168 ClassElement lookupTarget = targetType.element; |
| 169 String constructorName = | 169 String constructorName = |
| 170 visitor.getRedirectingThisOrSuperConstructorName(node).text; | 170 visitor.getRedirectingThisOrSuperConstructorName(node).text; |
| 171 ConstructorElement foundConstructor = | 171 ConstructorElement foundConstructor = |
| 172 findConstructor(constructor.library, lookupTarget, constructorName); | 172 findConstructor(constructor.library, lookupTarget, constructorName); |
| 173 | 173 |
| 174 final bool isImplicitSuperCall = false; | |
| 175 final String className = lookupTarget.name; | 174 final String className = lookupTarget.name; |
| 176 CallStructure callStructure = argumentsResult.callStructure; | 175 CallStructure callStructure = argumentsResult.callStructure; |
| 177 ConstructorElement calledConstructor = verifyThatConstructorMatchesCall( | 176 ConstructorElement calledConstructor = verifyThatConstructorMatchesCall( |
| 178 node, foundConstructor, callStructure, className, | 177 node, foundConstructor, callStructure, className, |
| 179 constructorName: constructorName, | 178 constructorName: constructorName, |
| 180 isThisCall: !isSuperCall, | 179 isThisCall: !isSuperCall, |
| 181 isImplicitSuperCall: false); | 180 isImplicitSuperCall: false); |
| 182 // TODO(johnniwinther): Remove this when information is pulled from an | 181 // TODO(johnniwinther): Remove this when information is pulled from an |
| 183 // [InitializerStructure]. | 182 // [InitializerStructure]. |
| 184 registry.useElement(node, calledConstructor); | 183 registry.useElement(node, calledConstructor); |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 // constructors. | 849 // constructors. |
| 851 return null; | 850 return null; |
| 852 } | 851 } |
| 853 // TODO(johnniwinther): Use [Name] for lookup. | 852 // TODO(johnniwinther): Use [Name] for lookup. |
| 854 ConstructorElement constructor = cls.lookupConstructor(constructorName); | 853 ConstructorElement constructor = cls.lookupConstructor(constructorName); |
| 855 if (constructor != null) { | 854 if (constructor != null) { |
| 856 constructor = constructor.declaration; | 855 constructor = constructor.declaration; |
| 857 } | 856 } |
| 858 return constructor; | 857 return constructor; |
| 859 } | 858 } |
| OLD | NEW |