| 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, Resolution; |
| 9 import '../compiler.dart' show Compiler; | |
| 10 import '../constants/constructors.dart' | 9 import '../constants/constructors.dart' |
| 11 show | 10 show |
| 12 GenerativeConstantConstructor, | 11 GenerativeConstantConstructor, |
| 13 RedirectingGenerativeConstantConstructor; | 12 RedirectingGenerativeConstantConstructor; |
| 14 import '../constants/expressions.dart'; | 13 import '../constants/expressions.dart'; |
| 15 import '../dart_types.dart'; | 14 import '../dart_types.dart'; |
| 16 import '../elements/elements.dart'; | 15 import '../elements/elements.dart'; |
| 17 import '../elements/modelx.dart' | 16 import '../elements/modelx.dart' |
| 18 show | 17 show |
| 19 ConstructorElementX, | 18 ConstructorElementX, |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 } | 468 } |
| 470 visitor.scope = oldScope; | 469 visitor.scope = oldScope; |
| 471 return null; // If there was no redirection always return null. | 470 return null; // If there was no redirection always return null. |
| 472 } | 471 } |
| 473 } | 472 } |
| 474 | 473 |
| 475 class ConstructorResolver extends CommonResolverVisitor<ConstructorResult> { | 474 class ConstructorResolver extends CommonResolverVisitor<ConstructorResult> { |
| 476 final ResolverVisitor resolver; | 475 final ResolverVisitor resolver; |
| 477 final bool inConstContext; | 476 final bool inConstContext; |
| 478 | 477 |
| 479 ConstructorResolver(Compiler compiler, this.resolver, | 478 ConstructorResolver(Resolution resolution, this.resolver, |
| 480 {bool this.inConstContext: false}) | 479 {bool this.inConstContext: false}) |
| 481 : super(compiler); | 480 : super(resolution); |
| 482 | 481 |
| 483 ResolutionRegistry get registry => resolver.registry; | 482 ResolutionRegistry get registry => resolver.registry; |
| 484 | 483 |
| 485 visitNode(Node node) { | 484 visitNode(Node node) { |
| 486 throw 'not supported'; | 485 throw 'not supported'; |
| 487 } | 486 } |
| 488 | 487 |
| 489 ConstructorResult reportAndCreateErroneousConstructorElement( | 488 ConstructorResult reportAndCreateErroneousConstructorElement( |
| 490 Spannable diagnosticNode, | 489 Spannable diagnosticNode, |
| 491 ConstructorResultKind resultKind, | 490 ConstructorResultKind resultKind, |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 // constructors. | 887 // constructors. |
| 889 return null; | 888 return null; |
| 890 } | 889 } |
| 891 // TODO(johnniwinther): Use [Name] for lookup. | 890 // TODO(johnniwinther): Use [Name] for lookup. |
| 892 ConstructorElement constructor = cls.lookupConstructor(constructorName); | 891 ConstructorElement constructor = cls.lookupConstructor(constructorName); |
| 893 if (constructor != null) { | 892 if (constructor != null) { |
| 894 constructor = constructor.declaration; | 893 constructor = constructor.declaration; |
| 895 } | 894 } |
| 896 return constructor; | 895 return constructor; |
| 897 } | 896 } |
| OLD | NEW |