| 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 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1436 return l1.isEmpty && l2.isEmpty; | 1436 return l1.isEmpty && l2.isEmpty; |
| 1437 }); | 1437 }); |
| 1438 } | 1438 } |
| 1439 | 1439 |
| 1440 bool testTokens( | 1440 bool testTokens( |
| 1441 var object1, var object2, String property, Token token1, Token token2) { | 1441 var object1, var object2, String property, Token token1, Token token2) { |
| 1442 return strategy.test(object1, object2, property, token1, token2, | 1442 return strategy.test(object1, object2, property, token1, token2, |
| 1443 (Token t1, Token t2) { | 1443 (Token t1, Token t2) { |
| 1444 if (t1 == t2) return true; | 1444 if (t1 == t2) return true; |
| 1445 if (t1 == null || t2 == null) return false; | 1445 if (t1 == null || t2 == null) return false; |
| 1446 return | 1446 return strategy.test( |
| 1447 strategy.test(t1, t2, 'charOffset', t1.charOffset, t2.charOffset) && | 1447 t1, t2, 'charOffset', t1.charOffset, t2.charOffset) && |
| 1448 strategy.test(t1, t2, 'info', t1.info, t2.info) && | 1448 strategy.test(t1, t2, 'info', t1.info, t2.info) && |
| 1449 strategy.test(t1, t2, 'value', t1.value, t2.value); | 1449 strategy.test(t1, t2, 'value', t1.value, t2.value); |
| 1450 }); | 1450 }); |
| 1451 } | 1451 } |
| 1452 | 1452 |
| 1453 @override | 1453 @override |
| 1454 bool visitAssert(Assert node1, Assert node2) { | 1454 bool visitAssert(Assert node1, Assert node2) { |
| 1455 return testTokens(node1, node2, 'assertToken', node1.assertToken, | 1455 return testTokens(node1, node2, 'assertToken', node1.assertToken, |
| 1456 node2.assertToken) && | 1456 node2.assertToken) && |
| 1457 testNodes( | 1457 testNodes( |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2124 } | 2124 } |
| 2125 | 2125 |
| 2126 bool areMetadataAnnotationsEquivalent( | 2126 bool areMetadataAnnotationsEquivalent( |
| 2127 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { | 2127 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { |
| 2128 if (metadata1 == metadata2) return true; | 2128 if (metadata1 == metadata2) return true; |
| 2129 if (metadata1 == null || metadata2 == null) return false; | 2129 if (metadata1 == null || metadata2 == null) return false; |
| 2130 return areElementsEquivalent( | 2130 return areElementsEquivalent( |
| 2131 metadata1.annotatedElement, metadata2.annotatedElement) && | 2131 metadata1.annotatedElement, metadata2.annotatedElement) && |
| 2132 areConstantsEquivalent(metadata1.constant, metadata2.constant); | 2132 areConstantsEquivalent(metadata1.constant, metadata2.constant); |
| 2133 } | 2133 } |
| OLD | NEW |