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 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1825 @override | 1825 @override |
1826 bool visitStatement(Statement node1, Statement node2) { | 1826 bool visitStatement(Statement node1, Statement node2) { |
1827 throw new UnsupportedError('Unexpected nodes: $node1 <> $node2'); | 1827 throw new UnsupportedError('Unexpected nodes: $node1 <> $node2'); |
1828 } | 1828 } |
1829 | 1829 |
1830 @override | 1830 @override |
1831 bool visitStringNode(StringNode node1, StringNode node2) { | 1831 bool visitStringNode(StringNode node1, StringNode node2) { |
1832 throw new UnsupportedError('Unexpected nodes: $node1 <> $node2'); | 1832 throw new UnsupportedError('Unexpected nodes: $node1 <> $node2'); |
1833 } | 1833 } |
1834 } | 1834 } |
1835 | |
1836 bool areMetadataAnnotationsEquivalent( | |
1837 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { | |
1838 if (metadata1 == metadata2) return true; | |
1839 if (metadata1 == null || metadata2 == null) return false; | |
1840 return areElementsEquivalent( | |
1841 metadata1.annotatedElement, metadata2.annotatedElement) && | |
1842 areConstantsEquivalent(metadata1.constant, metadata2.constant); | |
1843 } | |
OLD | NEW |