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

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

Issue 2847143002: Fix KernelEquivalence.entityEquivalence for equi-named instance/top-level members (Closed)
Patch Set: Updated cf. comment 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/kernel/closed_world_tester.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 bf5729e3674a25e05f6ae61a65ea47275cba6e9c..79a702e8d7f313a82990a5027482b0f2600f5458 100644
--- a/tests/compiler/dart2js/serialization/test_helper.dart
+++ b/tests/compiler/dart2js/serialization/test_helper.dart
@@ -721,14 +721,10 @@ class KernelEquivalence {
return false;
case ElementKind.FUNCTION:
if (b is KMethod) {
- if (!strategy.test(a, b, 'name', a.name, b.name)) return false;
- if (b.enclosingClass != null) {
- return strategy.testElements(
- a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass);
- } else {
- return strategy.testElements(
- a, b, 'library', a.library, testing.getLibraryForFunction(b));
- }
+ return strategy.test(a, b, 'name', a.name, b.name) &&
+ strategy.testElements(
+ a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass) &&
+ strategy.testElements(a, b, 'library', a.library, b.library);
} else if (b is KLocalFunction) {
LocalFunctionElement aLocalFunction = a;
return strategy.test(a, b, 'name', a.name, b.name ?? '') &&
@@ -740,38 +736,26 @@ class KernelEquivalence {
return false;
case ElementKind.GETTER:
if (b is KGetter) {
- if (!strategy.test(a, b, 'name', a.name, b.name)) return false;
- if (b.enclosingClass != null) {
- return strategy.testElements(
- a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass);
- } else {
- return strategy.testElements(
- a, b, 'library', a.library, testing.getLibraryForFunction(b));
- }
+ return strategy.test(a, b, 'name', a.name, b.name) &&
+ strategy.testElements(
+ a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass) &&
+ strategy.testElements(a, b, 'library', a.library, b.library);
}
return false;
case ElementKind.SETTER:
if (b is KSetter) {
- if (!strategy.test(a, b, 'name', a.name, b.name)) return false;
- if (b.enclosingClass != null) {
- return strategy.testElements(
- a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass);
- } else {
- return strategy.testElements(
- a, b, 'library', a.library, testing.getLibraryForFunction(b));
- }
+ return strategy.test(a, b, 'name', a.name, b.name) &&
+ strategy.testElements(
+ a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass) &&
+ strategy.testElements(a, b, 'library', a.library, b.library);
}
return false;
case ElementKind.FIELD:
if (b is KField) {
- if (!strategy.test(a, b, 'name', a.name, b.name)) return false;
- if (b.enclosingClass != null) {
- return strategy.testElements(
- a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass);
- } else {
- return strategy.testElements(
- a, b, 'library', a.library, testing.getLibraryForField(b));
- }
+ return strategy.test(a, b, 'name', a.name, b.name) &&
+ strategy.testElements(
+ a, b, 'enclosingClass', a.enclosingClass, b.enclosingClass) &&
+ strategy.testElements(a, b, 'library', a.library, b.library);
}
return false;
case ElementKind.TYPE_VARIABLE:
« no previous file with comments | « tests/compiler/dart2js/kernel/closed_world_tester.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698