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 '../common/resolution.dart'; | 9 import '../common/resolution.dart'; |
10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 bool visitLibraryElement(LibraryElement element1, LibraryElement element2) { | 236 bool visitLibraryElement(LibraryElement element1, LibraryElement element2) { |
237 return strategy.test(element1, element2, 'canonicalUri', | 237 return strategy.test(element1, element2, 'canonicalUri', |
238 element1.canonicalUri, element2.canonicalUri); | 238 element1.canonicalUri, element2.canonicalUri); |
239 } | 239 } |
240 | 240 |
241 @override | 241 @override |
242 bool visitCompilationUnitElement( | 242 bool visitCompilationUnitElement( |
243 CompilationUnitElement element1, CompilationUnitElement element2) { | 243 CompilationUnitElement element1, CompilationUnitElement element2) { |
244 return strategy.test( | 244 return strategy.test( |
245 element1, element2, 'name', element1.name, element2.name) && | 245 element1, element2, 'name', element1.name, element2.name) && |
| 246 strategy.test(element1, element2, 'script.resourceUri', |
| 247 element1.script.resourceUri, element2.script.resourceUri) && |
246 visit(element1.library, element2.library); | 248 visit(element1.library, element2.library); |
247 } | 249 } |
248 | 250 |
249 @override | 251 @override |
250 bool visitClassElement(ClassElement element1, ClassElement element2) { | 252 bool visitClassElement(ClassElement element1, ClassElement element2) { |
251 return strategy.test( | 253 return strategy.test( |
252 element1, element2, 'name', element1.name, element2.name) && | 254 element1, element2, 'name', element1.name, element2.name) && |
253 visit(element1.library, element2.library); | 255 visit(element1.library, element2.library); |
254 } | 256 } |
255 | 257 |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 int index = indices1.nodeIndices[node1]; | 800 int index = indices1.nodeIndices[node1]; |
799 RedirectingFactoryBody node2 = indices2.nodeList[index]; | 801 RedirectingFactoryBody node2 = indices2.nodeList[index]; |
800 success = strategy.testElements( | 802 success = strategy.testElements( |
801 node1, | 803 node1, |
802 node2, | 804 node2, |
803 'getRedirectingTargetConstructor($index)', | 805 'getRedirectingTargetConstructor($index)', |
804 elements1.getRedirectingTargetConstructor(node1), | 806 elements1.getRedirectingTargetConstructor(node1), |
805 elements2.getRedirectingTargetConstructor(node2)); | 807 elements2.getRedirectingTargetConstructor(node2)); |
806 } | 808 } |
807 } | 809 } |
OLD | NEW |