| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 ClassElement lookupTarget = targetType.element; | 215 ClassElement lookupTarget = targetType.element; |
| 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(new StaticUse.superConstructorInvoke( |
| 226 new StaticUse.constructorInvoke(calledConstructor, callStructure)); | 226 calledConstructor, callStructure)); |
| 227 } | 227 } |
| 228 | 228 |
| 229 if (isConst && isValidAsConstant) { | 229 if (isConst && isValidAsConstant) { |
| 230 return new ConstructedConstantExpression(targetType, result, | 230 return new ConstructedConstantExpression(targetType, result, |
| 231 CallStructure.NO_ARGS, const <ConstantExpression>[]); | 231 CallStructure.NO_ARGS, const <ConstantExpression>[]); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 return null; | 234 return null; |
| 235 } | 235 } |
| 236 | 236 |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 // constructors. | 881 // constructors. |
| 882 return null; | 882 return null; |
| 883 } | 883 } |
| 884 // TODO(johnniwinther): Use [Name] for lookup. | 884 // TODO(johnniwinther): Use [Name] for lookup. |
| 885 ConstructorElement constructor = cls.lookupConstructor(constructorName); | 885 ConstructorElement constructor = cls.lookupConstructor(constructorName); |
| 886 if (constructor != null) { | 886 if (constructor != null) { |
| 887 constructor = constructor.declaration; | 887 constructor = constructor.declaration; |
| 888 } | 888 } |
| 889 return constructor; | 889 return constructor; |
| 890 } | 890 } |
| OLD | NEW |