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

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 2039573002: Resynthesize ClassElementImpl fields and property accessors lazily. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
Index: pkg/analyzer/test/src/summary/resynthesize_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
index 7e682a9bf25c43f04f9e0254a64f68fa6f61aea4..2fec70b384eccbbc648b3eef6915d1bdd4ebe514 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -233,9 +233,11 @@ abstract class AbstractResynthesizeTest extends AbstractSingleUnitTest {
}
expect(r.accessors.length, o.accessors.length,
reason: '$desc accessors.length');
+ List<PropertyAccessorElement> rAccessors = _getSortedPropertyAccessors(r);
+ List<PropertyAccessorElement> oAccessors = _getSortedPropertyAccessors(o);
for (int i = 0; i < r.accessors.length; i++) {
- comparePropertyAccessorElements(r.accessors[i], o.accessors[i],
- '$desc accessor ${o.accessors[i].name}');
+ comparePropertyAccessorElements(
+ rAccessors[i], oAccessors[i], '$desc accessor ${oAccessors[i].name}');
}
expect(r.methods.length, o.methods.length, reason: '$desc methods.length');
for (int i = 0; i < r.methods.length; i++) {
@@ -1237,6 +1239,13 @@ abstract class AbstractResynthesizeTest extends AbstractSingleUnitTest {
expect(identifier.staticElement, isNull, reason: desc);
}
+ List<PropertyAccessorElement> _getSortedPropertyAccessors(
+ ClassElement classElement) {
+ List<PropertyAccessorElement> accessors = classElement.accessors.toList();
+ accessors.sort((a, b) => a.displayName.compareTo(b.displayName));
+ return accessors;
+ }
+
bool _hasModifier(Element element, Modifier modifier) {
if (modifier == Modifier.ABSTRACT) {
if (element is ClassElement) {

Powered by Google App Engine
This is Rietveld 408576698