Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Unified Diff: tests/compiler/dart2js/serialization/test_helper.dart

Issue 2845093003: Handle mixed in members (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/serialization/model_test_helper.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/serialization/test_helper.dart
diff --git a/tests/compiler/dart2js/serialization/test_helper.dart b/tests/compiler/dart2js/serialization/test_helper.dart
index 8de7ba2a3fa782f9ec9741bcdc2bdbb897d2b5e7..bf5729e3674a25e05f6ae61a65ea47275cba6e9c 100644
--- a/tests/compiler/dart2js/serialization/test_helper.dart
+++ b/tests/compiler/dart2js/serialization/test_helper.dart
@@ -675,44 +675,48 @@ class KernelEquivalence {
List<InterfaceType> aMixinTypes = [];
List<InterfaceType> bMixinTypes = [];
ClassElement aClass = a;
- while (aClass.isMixinApplication) {
- MixinApplicationElement aMixinApplication = aClass;
- aMixinTypes.add(aMixinApplication.mixinType);
- aClass = aMixinApplication.superclass;
- }
- KClass bClass = b;
- while (bClass != null) {
- InterfaceType mixinType = testing.getMixinTypeForClass(bClass);
- if (mixinType == null) break;
- bMixinTypes.add(mixinType);
- bClass = testing.getSuperclassForClass(bClass);
- }
- if (aMixinTypes.isNotEmpty || aMixinTypes.isNotEmpty) {
- if (aClass.isNamedMixinApplication &&
- !strategy.test(a, b, 'name', a.name, b.name)) {
+ if (aClass.isUnnamedMixinApplication) {
+ if (!testing.isUnnamedMixinApplication(b)) {
return false;
}
- Pair<ClassEntity, ClassEntity> pair =
- new Pair<ClassEntity, ClassEntity>(aClass, bClass);
- if (assumedMixinApplications.contains(pair)) {
- return true;
- } else {
- assumedMixinApplications.add(pair);
- bool result = strategy.testTypeLists(
- a, b, 'mixinTypes', aMixinTypes, bMixinTypes);
- assumedMixinApplications.remove(pair);
- return result;
+ while (aClass.isMixinApplication) {
+ MixinApplicationElement aMixinApplication = aClass;
+ aMixinTypes.add(aMixinApplication.mixinType);
+ aClass = aMixinApplication.superclass;
+ }
+ KClass bClass = b;
+ while (bClass != null) {
+ InterfaceType mixinType = testing.getMixinTypeForClass(bClass);
+ if (mixinType == null) break;
+ bMixinTypes.add(mixinType);
+ bClass = testing.getSuperclassForClass(bClass);
+ }
+ if (aMixinTypes.isNotEmpty || aMixinTypes.isNotEmpty) {
+ Pair<ClassEntity, ClassEntity> pair =
+ new Pair<ClassEntity, ClassEntity>(aClass, bClass);
+ if (assumedMixinApplications.contains(pair)) {
+ return true;
+ } else {
+ assumedMixinApplications.add(pair);
+ bool result = strategy.testTypeLists(
+ a, b, 'mixinTypes', aMixinTypes, bMixinTypes);
+ assumedMixinApplications.remove(pair);
+ return result;
+ }
+ }
+ } else {
+ if (testing.isUnnamedMixinApplication(b)) {
+ return false;
}
}
return strategy.test(a, b, 'name', a.name, b.name) &&
- strategy.testElements(
- a, b, 'library', a.library, testing.getLibraryForClass(b));
+ strategy.testElements(a, b, 'library', a.library, b.library);
}
return false;
case ElementKind.LIBRARY:
if (b is KLibrary) {
LibraryElement libraryA = a;
- return libraryA.canonicalUri == testing.getLibraryUri(b);
+ return libraryA.canonicalUri == b.canonicalUri;
}
return false;
case ElementKind.FUNCTION:
« no previous file with comments | « tests/compiler/dart2js/serialization/model_test_helper.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698