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

Unified Diff: pkg/compiler/lib/src/serialization/equivalence.dart

Issue 2662253002: Handle private dynamic access in impact_test. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | tests/compiler/dart2js/kernel/impact_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/equivalence.dart
diff --git a/pkg/compiler/lib/src/serialization/equivalence.dart b/pkg/compiler/lib/src/serialization/equivalence.dart
index 592f82639b71fb59c04708501279394e94457cdc..91110d1ee5000d9dd961bc7e310c409d8abd73c0 100644
--- a/pkg/compiler/lib/src/serialization/equivalence.dart
+++ b/pkg/compiler/lib/src/serialization/equivalence.dart
@@ -150,26 +150,27 @@ bool areConstantValueListsEquivalent(
}
/// Returns `true` if the selectors [a] and [b] are equivalent.
-bool areSelectorsEquivalent(Selector a, Selector b) {
+bool areSelectorsEquivalent(Selector a, Selector b,
+ {TestStrategy strategy: const TestStrategy()}) {
if (identical(a, b)) return true;
if (a == null || b == null) return false;
return a.kind == b.kind &&
a.callStructure == b.callStructure &&
- areNamesEquivalent(a.memberName, b.memberName);
+ areNamesEquivalent(a.memberName, b.memberName, strategy: strategy);
}
/// Returns `true` if the names [a] and [b] are equivalent.
-bool areNamesEquivalent(Name a, Name b) {
- LibraryElement library1 = a.library;
- LibraryElement library2 = b.library;
+bool areNamesEquivalent(Name a, Name b,
+ {TestStrategy strategy: const TestStrategy()}) {
return a.text == b.text &&
a.isSetter == b.isSetter &&
- areElementsEquivalent(library1, library2);
+ strategy.testElements(a, b, 'library', a.library, b.library);
}
/// Returns `true` if the dynamic uses [a] and [b] are equivalent.
-bool areDynamicUsesEquivalent(DynamicUse a, DynamicUse b) {
- return areSelectorsEquivalent(a.selector, b.selector);
+bool areDynamicUsesEquivalent(DynamicUse a, DynamicUse b,
+ {TestStrategy strategy: const TestStrategy()}) {
+ return areSelectorsEquivalent(a.selector, b.selector, strategy: strategy);
}
/// Returns `true` if the static uses [a] and [b] are equivalent.
@@ -1026,8 +1027,14 @@ bool testResolutionImpactEquivalence(
impact1.constantLiterals,
impact2.constantLiterals,
areConstantsEquivalent) &&
- strategy.testSets(impact1, impact2, 'dynamicUses', impact1.dynamicUses,
- impact2.dynamicUses, areDynamicUsesEquivalent) &&
+ strategy.testSets(
+ impact1,
+ impact2,
+ 'dynamicUses',
+ impact1.dynamicUses,
+ impact2.dynamicUses,
+ (a, b) =>
+ areDynamicUsesEquivalent(a, b, strategy: strategy.testOnly)) &&
strategy.testSets(
impact1, impact2, 'features', impact1.features, impact2.features) &&
strategy.testSets(
« no previous file with comments | « no previous file | tests/compiler/dart2js/kernel/impact_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698