| 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 /// Functions for asserting equivalence across serialization. | 5 /// Functions for asserting equivalence across serialization. |
| 6 | 6 |
| 7 library dart2js.serialization.equivalence; | 7 library dart2js.serialization.equivalence; |
| 8 | 8 |
| 9 import '../closure.dart'; | 9 import '../closure.dart'; |
| 10 import '../common/resolution.dart'; | 10 import '../common/resolution.dart'; |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 covariant ResolutionVoidType argument) => | 705 covariant ResolutionVoidType argument) => |
| 706 true; | 706 true; |
| 707 | 707 |
| 708 @override | 708 @override |
| 709 bool visitInterfaceType(covariant ResolutionInterfaceType type, | 709 bool visitInterfaceType(covariant ResolutionInterfaceType type, |
| 710 covariant ResolutionInterfaceType other) { | 710 covariant ResolutionInterfaceType other) { |
| 711 return visitGenericType(type, other); | 711 return visitGenericType(type, other); |
| 712 } | 712 } |
| 713 | 713 |
| 714 @override | 714 @override |
| 715 bool visitTypedefType( | 715 bool visitTypedefType(covariant ResolutionTypedefType type, |
| 716 ResolutionTypedefType type, covariant ResolutionTypedefType other) { | 716 covariant ResolutionTypedefType other) { |
| 717 return visitGenericType(type, other); | 717 return visitGenericType(type, other); |
| 718 } | 718 } |
| 719 } | 719 } |
| 720 | 720 |
| 721 /// Visitor that checks for structural equivalence of [ConstantExpression]s. | 721 /// Visitor that checks for structural equivalence of [ConstantExpression]s. |
| 722 class ConstantEquivalence | 722 class ConstantEquivalence |
| 723 implements ConstantExpressionVisitor<bool, ConstantExpression> { | 723 implements ConstantExpressionVisitor<bool, ConstantExpression> { |
| 724 final TestStrategy strategy; | 724 final TestStrategy strategy; |
| 725 | 725 |
| 726 const ConstantEquivalence([this.strategy = const TestStrategy()]); | 726 const ConstantEquivalence([this.strategy = const TestStrategy()]); |
| (...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2175 } | 2175 } |
| 2176 | 2176 |
| 2177 bool areMetadataAnnotationsEquivalent( | 2177 bool areMetadataAnnotationsEquivalent( |
| 2178 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { | 2178 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { |
| 2179 if (metadata1 == metadata2) return true; | 2179 if (metadata1 == metadata2) return true; |
| 2180 if (metadata1 == null || metadata2 == null) return false; | 2180 if (metadata1 == null || metadata2 == null) return false; |
| 2181 return areElementsEquivalent( | 2181 return areElementsEquivalent( |
| 2182 metadata1.annotatedElement, metadata2.annotatedElement) && | 2182 metadata1.annotatedElement, metadata2.annotatedElement) && |
| 2183 areConstantsEquivalent(metadata1.constant, metadata2.constant); | 2183 areConstantsEquivalent(metadata1.constant, metadata2.constant); |
| 2184 } | 2184 } |
| OLD | NEW |