| 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.dart'; | 10 import '../common.dart'; |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 bool visitMalformedType(MalformedType type, MalformedType other) => true; | 555 bool visitMalformedType(MalformedType type, MalformedType other) => true; |
| 556 | 556 |
| 557 @override | 557 @override |
| 558 bool visitStatementType(StatementType type, StatementType other) { | 558 bool visitStatementType(StatementType type, StatementType other) { |
| 559 throw new UnsupportedError("Unsupported type: $type"); | 559 throw new UnsupportedError("Unsupported type: $type"); |
| 560 } | 560 } |
| 561 | 561 |
| 562 @override | 562 @override |
| 563 bool visitTypeVariableType(TypeVariableType type, TypeVariableType other) { | 563 bool visitTypeVariableType(TypeVariableType type, TypeVariableType other) { |
| 564 return strategy.testElements( | 564 return strategy.testElements( |
| 565 type, other, 'element', type.element, other.element); | 565 type, other, 'element', type.element, other.element) && |
| 566 strategy.test(type, other, 'is MethodTypeVariableType', |
| 567 type is MethodTypeVariableType, other is MethodTypeVariableType); |
| 566 } | 568 } |
| 567 | 569 |
| 568 @override | 570 @override |
| 569 bool visitVoidType(VoidType type, VoidType argument) => true; | 571 bool visitVoidType(VoidType type, VoidType argument) => true; |
| 570 | 572 |
| 571 @override | 573 @override |
| 572 bool visitInterfaceType(InterfaceType type, InterfaceType other) { | 574 bool visitInterfaceType(InterfaceType type, InterfaceType other) { |
| 573 return visitGenericType(type, other); | 575 return visitGenericType(type, other); |
| 574 } | 576 } |
| 575 | 577 |
| (...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1834 } | 1836 } |
| 1835 | 1837 |
| 1836 bool areMetadataAnnotationsEquivalent( | 1838 bool areMetadataAnnotationsEquivalent( |
| 1837 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { | 1839 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { |
| 1838 if (metadata1 == metadata2) return true; | 1840 if (metadata1 == metadata2) return true; |
| 1839 if (metadata1 == null || metadata2 == null) return false; | 1841 if (metadata1 == null || metadata2 == null) return false; |
| 1840 return areElementsEquivalent( | 1842 return areElementsEquivalent( |
| 1841 metadata1.annotatedElement, metadata2.annotatedElement) && | 1843 metadata1.annotatedElement, metadata2.annotatedElement) && |
| 1842 areConstantsEquivalent(metadata1.constant, metadata2.constant); | 1844 areConstantsEquivalent(metadata1.constant, metadata2.constant); |
| 1843 } | 1845 } |
| OLD | NEW |