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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
509 | 509 |
510 @override | 510 @override |
511 bool visitSetterElement(SetterElement element1, SetterElement element2) { | 511 bool visitSetterElement(SetterElement element1, SetterElement element2) { |
512 return checkMembers(element1, element2); | 512 return checkMembers(element1, element2); |
513 } | 513 } |
514 | 514 |
515 @override | 515 @override |
516 bool visitLocalFunctionElement( | 516 bool visitLocalFunctionElement( |
517 LocalFunctionElement element1, LocalFunctionElement element2) { | 517 LocalFunctionElement element1, LocalFunctionElement element2) { |
518 // TODO(johnniwinther): Define an equivalence on locals. | 518 // TODO(johnniwinther): Define an equivalence on locals. |
519 return checkMembers(element1.memberContext, element2.memberContext); | 519 return strategy.test(element1, element2, 'name', element1.name, element2.nam e) && checkMembers(element1.memberContext, element2.memberContext); |
Harry Terkelsen
2016/09/22 19:20:15
long lines
Johnni Winther
2016/09/23 09:01:50
Done.
| |
520 } | 520 } |
521 | 521 |
522 @override | 522 @override |
523 bool visitLocalVariableElement( | 523 bool visitLocalVariableElement( |
524 LocalVariableElement element1, LocalVariableElement element2) { | 524 LocalVariableElement element1, LocalVariableElement element2) { |
525 // TODO(johnniwinther): Define an equivalence on locals. | 525 // TODO(johnniwinther): Define an equivalence on locals. |
526 return checkMembers(element1.memberContext, element2.memberContext); | 526 return strategy.test(element1, element2, 'name', element1.name, element2.nam e) && checkMembers(element1.memberContext, element2.memberContext); |
527 } | 527 } |
528 | 528 |
529 bool visitAbstractFieldElement( | 529 bool visitAbstractFieldElement( |
530 AbstractFieldElement element1, AbstractFieldElement element2) { | 530 AbstractFieldElement element1, AbstractFieldElement element2) { |
531 return checkMembers(element1, element2); | 531 return checkMembers(element1, element2); |
532 } | 532 } |
533 | 533 |
534 @override | 534 @override |
535 bool visitTypeVariableElement( | 535 bool visitTypeVariableElement( |
536 TypeVariableElement element1, TypeVariableElement element2) { | 536 TypeVariableElement element1, TypeVariableElement element2) { |
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2027 } | 2027 } |
2028 | 2028 |
2029 bool areMetadataAnnotationsEquivalent( | 2029 bool areMetadataAnnotationsEquivalent( |
2030 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { | 2030 MetadataAnnotation metadata1, MetadataAnnotation metadata2) { |
2031 if (metadata1 == metadata2) return true; | 2031 if (metadata1 == metadata2) return true; |
2032 if (metadata1 == null || metadata2 == null) return false; | 2032 if (metadata1 == null || metadata2 == null) return false; |
2033 return areElementsEquivalent( | 2033 return areElementsEquivalent( |
2034 metadata1.annotatedElement, metadata2.annotatedElement) && | 2034 metadata1.annotatedElement, metadata2.annotatedElement) && |
2035 areConstantsEquivalent(metadata1.constant, metadata2.constant); | 2035 areConstantsEquivalent(metadata1.constant, metadata2.constant); |
2036 } | 2036 } |
OLD | NEW |