| 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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 return strategy.testElements( | 622 return strategy.testElements( |
| 623 type, other, 'element', type.element, other.element) && | 623 type, other, 'element', type.element, other.element) && |
| 624 strategy.testTypeLists(type, other, 'typeArguments', type.typeArguments, | 624 strategy.testTypeLists(type, other, 'typeArguments', type.typeArguments, |
| 625 other.typeArguments); | 625 other.typeArguments); |
| 626 } | 626 } |
| 627 | 627 |
| 628 @override | 628 @override |
| 629 bool visitMalformedType(MalformedType type, MalformedType other) => true; | 629 bool visitMalformedType(MalformedType type, MalformedType other) => true; |
| 630 | 630 |
| 631 @override | 631 @override |
| 632 bool visitStatementType(StatementType type, StatementType other) { | |
| 633 throw new UnsupportedError("Unsupported type: $type"); | |
| 634 } | |
| 635 | |
| 636 @override | |
| 637 bool visitTypeVariableType(TypeVariableType type, TypeVariableType other) { | 632 bool visitTypeVariableType(TypeVariableType type, TypeVariableType other) { |
| 638 return strategy.testElements( | 633 return strategy.testElements( |
| 639 type, other, 'element', type.element, other.element) && | 634 type, other, 'element', type.element, other.element) && |
| 640 strategy.test(type, other, 'is MethodTypeVariableType', | 635 strategy.test(type, other, 'is MethodTypeVariableType', |
| 641 type is MethodTypeVariableType, other is MethodTypeVariableType); | 636 type is MethodTypeVariableType, other is MethodTypeVariableType); |
| 642 } | 637 } |
| 643 | 638 |
| 644 @override | 639 @override |
| 645 bool visitVoidType(VoidType type, VoidType argument) => true; | 640 bool visitVoidType(VoidType type, VoidType argument) => true; |
| 646 | 641 |
| (...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2033 } | 2028 } |
| 2034 | 2029 |
| 2035 bool areMetadataAnnotationsEquivalent( | 2030 bool areMetadataAnnotationsEquivalent( |
| 2036 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { | 2031 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { |
| 2037 if (metadata1 == metadata2) return true; | 2032 if (metadata1 == metadata2) return true; |
| 2038 if (metadata1 == null || metadata2 == null) return false; | 2033 if (metadata1 == null || metadata2 == null) return false; |
| 2039 return areElementsEquivalent( | 2034 return areElementsEquivalent( |
| 2040 metadata1.annotatedElement, metadata2.annotatedElement) && | 2035 metadata1.annotatedElement, metadata2.annotatedElement) && |
| 2041 areConstantsEquivalent(metadata1.constant, metadata2.constant); | 2036 areConstantsEquivalent(metadata1.constant, metadata2.constant); |
| 2042 } | 2037 } |
| OLD | NEW |