OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.kernel.equivalence; | 5 library dart2js.kernel.equivalence; |
6 | 6 |
7 import 'package:compiler/src/common/backend_api.dart'; | 7 import 'package:compiler/src/common/backend_api.dart'; |
8 import 'package:compiler/src/common/resolution.dart'; | 8 import 'package:compiler/src/common/resolution.dart'; |
9 import 'package:compiler/src/common/work.dart'; | 9 import 'package:compiler/src/common/work.dart'; |
10 import 'package:compiler/src/constants/expressions.dart'; | 10 import 'package:compiler/src/constants/expressions.dart'; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass); | 56 a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass); |
57 } | 57 } |
58 return false; | 58 return false; |
59 case ElementKind.FACTORY_CONSTRUCTOR: | 59 case ElementKind.FACTORY_CONSTRUCTOR: |
60 if (b is IndexedConstructor && b.isFactoryConstructor) { | 60 if (b is IndexedConstructor && b.isFactoryConstructor) { |
61 return strategy.test(a, b, 'name', a.name, b.name) && | 61 return strategy.test(a, b, 'name', a.name, b.name) && |
62 strategy.testElements( | 62 strategy.testElements( |
63 a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass); | 63 a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass); |
64 } | 64 } |
65 return false; | 65 return false; |
| 66 case ElementKind.GENERATIVE_CONSTRUCTOR_BODY: |
| 67 ConstructorBodyElement aConstructorBody = a; |
| 68 if (b is ConstructorBodyEntity) { |
| 69 return entityEquivalence(aConstructorBody.constructor, b.constructor); |
| 70 } |
| 71 return false; |
66 case ElementKind.CLASS: | 72 case ElementKind.CLASS: |
67 if (b is IndexedClass) { | 73 if (b is IndexedClass) { |
68 List<InterfaceType> aMixinTypes = []; | 74 List<InterfaceType> aMixinTypes = []; |
69 List<InterfaceType> bMixinTypes = []; | 75 List<InterfaceType> bMixinTypes = []; |
70 ClassElement aClass = a; | 76 ClassElement aClass = a; |
71 if (aClass.isUnnamedMixinApplication) { | 77 if (aClass.isUnnamedMixinApplication) { |
72 if (!testing.isUnnamedMixinApplication(b)) { | 78 if (!testing.isUnnamedMixinApplication(b)) { |
73 return false; | 79 return false; |
74 } | 80 } |
75 while (aClass.isMixinApplication) { | 81 while (aClass.isMixinApplication) { |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 for (ConstructorElement constructor in element.constructors) { | 306 for (ConstructorElement constructor in element.constructors) { |
301 if (!constructor.isRedirectingFactory) { | 307 if (!constructor.isRedirectingFactory) { |
302 return true; | 308 return true; |
303 } | 309 } |
304 } | 310 } |
305 // The class cannot itself be instantiated. | 311 // The class cannot itself be instantiated. |
306 return false; | 312 return false; |
307 } | 313 } |
308 return true; | 314 return true; |
309 } | 315 } |
OLD | NEW |