| 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 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 strategy.test( | 1446 return strategy.test( |
| 1447 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.lexeme, t2.lexeme); |
| 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( |
| 1458 node1, node2, 'condition', node1.condition, node2.condition) && | 1458 node1, node2, 'condition', node1.condition, node2.condition) && |
| 1459 testNodes(node1, node2, 'message', node1.message, node2.message); | 1459 testNodes(node1, node2, 'message', node1.message, node2.message); |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2140 } | 2140 } |
| 2141 | 2141 |
| 2142 bool areMetadataAnnotationsEquivalent( | 2142 bool areMetadataAnnotationsEquivalent( |
| 2143 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { | 2143 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { |
| 2144 if (metadata1 == metadata2) return true; | 2144 if (metadata1 == metadata2) return true; |
| 2145 if (metadata1 == null || metadata2 == null) return false; | 2145 if (metadata1 == null || metadata2 == null) return false; |
| 2146 return areElementsEquivalent( | 2146 return areElementsEquivalent( |
| 2147 metadata1.annotatedElement, metadata2.annotatedElement) && | 2147 metadata1.annotatedElement, metadata2.annotatedElement) && |
| 2148 areConstantsEquivalent(metadata1.constant, metadata2.constant); | 2148 areConstantsEquivalent(metadata1.constant, metadata2.constant); |
| 2149 } | 2149 } |
| OLD | NEW |