| 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 Resolution; | 8 import '../common/resolution.dart' show Resolution; |
| 9 import '../constants/constructors.dart' | 9 import '../constants/constructors.dart' |
| 10 show | 10 show |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 ConstructorElement calledConstructor = | 216 ConstructorElement calledConstructor = |
| 217 findConstructor(constructor.library, lookupTarget, ''); | 217 findConstructor(constructor.library, lookupTarget, ''); |
| 218 | 218 |
| 219 final String className = lookupTarget.name; | 219 final String className = lookupTarget.name; |
| 220 CallStructure callStructure = CallStructure.NO_ARGS; | 220 CallStructure callStructure = CallStructure.NO_ARGS; |
| 221 ConstructorElement result = verifyThatConstructorMatchesCall( | 221 ConstructorElement result = verifyThatConstructorMatchesCall( |
| 222 functionNode, calledConstructor, callStructure, className, | 222 functionNode, calledConstructor, callStructure, className, |
| 223 isImplicitSuperCall: true); | 223 isImplicitSuperCall: true); |
| 224 if (!result.isError) { | 224 if (!result.isError) { |
| 225 registry.registerStaticUse( | 225 registry.registerStaticUse( |
| 226 new StaticUse.constructorInvoke(calledConstructor, callStructure)); | 226 new StaticUse.superConstructorInvoke( |
| 227 calledConstructor, callStructure)); |
| 227 } | 228 } |
| 228 | 229 |
| 229 if (isConst && isValidAsConstant) { | 230 if (isConst && isValidAsConstant) { |
| 230 return new ConstructedConstantExpression(targetType, result, | 231 return new ConstructedConstantExpression(targetType, result, |
| 231 CallStructure.NO_ARGS, const <ConstantExpression>[]); | 232 CallStructure.NO_ARGS, const <ConstantExpression>[]); |
| 232 } | 233 } |
| 233 } | 234 } |
| 234 return null; | 235 return null; |
| 235 } | 236 } |
| 236 | 237 |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 // constructors. | 882 // constructors. |
| 882 return null; | 883 return null; |
| 883 } | 884 } |
| 884 // TODO(johnniwinther): Use [Name] for lookup. | 885 // TODO(johnniwinther): Use [Name] for lookup. |
| 885 ConstructorElement constructor = cls.lookupConstructor(constructorName); | 886 ConstructorElement constructor = cls.lookupConstructor(constructorName); |
| 886 if (constructor != null) { | 887 if (constructor != null) { |
| 887 constructor = constructor.declaration; | 888 constructor = constructor.declaration; |
| 888 } | 889 } |
| 889 return constructor; | 890 return constructor; |
| 890 } | 891 } |
| OLD | NEW |