| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass); | 54 a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass); |
| 55 } | 55 } |
| 56 return false; | 56 return false; |
| 57 case ElementKind.FACTORY_CONSTRUCTOR: | 57 case ElementKind.FACTORY_CONSTRUCTOR: |
| 58 if (b is KFactoryConstructor) { | 58 if (b is KFactoryConstructor) { |
| 59 return strategy.test(a, b, 'name', a.name, b.name) && | 59 return strategy.test(a, b, 'name', a.name, b.name) && |
| 60 strategy.testElements( | 60 strategy.testElements( |
| 61 a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass); | 61 a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass); |
| 62 } | 62 } |
| 63 return false; | 63 return false; |
| 64 case ElementKind.GENERATIVE_CONSTRUCTOR_BODY: |
| 65 ConstructorBodyElement aConstructorBody = a; |
| 66 if (b is ConstructorBodyEntity) { |
| 67 return entityEquivalence(aConstructorBody.constructor, b.constructor); |
| 68 } |
| 69 return false; |
| 64 case ElementKind.CLASS: | 70 case ElementKind.CLASS: |
| 65 if (b is KClass) { | 71 if (b is KClass) { |
| 66 List<InterfaceType> aMixinTypes = []; | 72 List<InterfaceType> aMixinTypes = []; |
| 67 List<InterfaceType> bMixinTypes = []; | 73 List<InterfaceType> bMixinTypes = []; |
| 68 ClassElement aClass = a; | 74 ClassElement aClass = a; |
| 69 if (aClass.isUnnamedMixinApplication) { | 75 if (aClass.isUnnamedMixinApplication) { |
| 70 if (!testing.isUnnamedMixinApplication(b)) { | 76 if (!testing.isUnnamedMixinApplication(b)) { |
| 71 return false; | 77 return false; |
| 72 } | 78 } |
| 73 while (aClass.isMixinApplication) { | 79 while (aClass.isMixinApplication) { |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 for (ConstructorElement constructor in element.constructors) { | 304 for (ConstructorElement constructor in element.constructors) { |
| 299 if (!constructor.isRedirectingFactory) { | 305 if (!constructor.isRedirectingFactory) { |
| 300 return true; | 306 return true; |
| 301 } | 307 } |
| 302 } | 308 } |
| 303 // The class cannot itself be instantiated. | 309 // The class cannot itself be instantiated. |
| 304 return false; | 310 return false; |
| 305 } | 311 } |
| 306 return true; | 312 return true; |
| 307 } | 313 } |
| OLD | NEW |