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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 CompilationUnitElement element1, CompilationUnitElement element2) { | 376 CompilationUnitElement element1, CompilationUnitElement element2) { |
377 return strategy.test( | 377 return strategy.test( |
378 element1, element2, 'name', element1.name, element2.name) && | 378 element1, element2, 'name', element1.name, element2.name) && |
379 strategy.test(element1, element2, 'script.resourceUri', | 379 strategy.test(element1, element2, 'script.resourceUri', |
380 element1.script.resourceUri, element2.script.resourceUri) && | 380 element1.script.resourceUri, element2.script.resourceUri) && |
381 visit(element1.library, element2.library); | 381 visit(element1.library, element2.library); |
382 } | 382 } |
383 | 383 |
384 @override | 384 @override |
385 bool visitClassElement(ClassElement element1, ClassElement element2) { | 385 bool visitClassElement(ClassElement element1, ClassElement element2) { |
386 if (!strategy.test(element1, element2, 'isUnnamedMixinApplication', | 386 if (!strategy.test( |
| 387 element1, |
| 388 element2, |
| 389 'isUnnamedMixinApplication', |
387 element1.isUnnamedMixinApplication, | 390 element1.isUnnamedMixinApplication, |
388 element2.isUnnamedMixinApplication)) { | 391 element2.isUnnamedMixinApplication)) { |
389 return false; | 392 return false; |
390 } | 393 } |
391 if (element1.isUnnamedMixinApplication) { | 394 if (element1.isUnnamedMixinApplication) { |
392 MixinApplicationElement mixin1 = element1; | 395 MixinApplicationElement mixin1 = element1; |
393 MixinApplicationElement mixin2 = element2; | 396 MixinApplicationElement mixin2 = element2; |
394 return strategy.testElements( | 397 return strategy.testElements( |
395 mixin1, mixin2, 'subclass', mixin1.subclass, mixin2.subclass) && | 398 mixin1, mixin2, 'subclass', mixin1.subclass, mixin2.subclass) && |
396 // Using the [mixinType] is more precise but requires the test to | 399 // Using the [mixinType] is more precise but requires the test to |
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1819 @override | 1822 @override |
1820 bool visitStatement(Statement node1, Statement node2) { | 1823 bool visitStatement(Statement node1, Statement node2) { |
1821 throw new UnsupportedError('Unexpected nodes: $node1 <> $node2'); | 1824 throw new UnsupportedError('Unexpected nodes: $node1 <> $node2'); |
1822 } | 1825 } |
1823 | 1826 |
1824 @override | 1827 @override |
1825 bool visitStringNode(StringNode node1, StringNode node2) { | 1828 bool visitStringNode(StringNode node1, StringNode node2) { |
1826 throw new UnsupportedError('Unexpected nodes: $node1 <> $node2'); | 1829 throw new UnsupportedError('Unexpected nodes: $node1 <> $node2'); |
1827 } | 1830 } |
1828 } | 1831 } |
OLD | NEW |