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

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

Issue 2987883003: Resynthesize top-level accessors and variables from Kernel. (Closed)
Patch Set: Created 3 years, 5 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/element_text.dart
diff --git a/pkg/analyzer/test/src/summary/element_text.dart b/pkg/analyzer/test/src/summary/element_text.dart
index c7897de4f32758a5f1824bb48b24292a6075658e..d6b0ca2c823dc2795863c8b196eb5c0d6090c990 100644
--- a/pkg/analyzer/test/src/summary/element_text.dart
+++ b/pkg/analyzer/test/src/summary/element_text.dart
@@ -681,6 +681,14 @@ class _ElementWriter {
PropertyInducingElement variable = e.variable;
expect(variable, isNotNull);
expect(variable.isSynthetic, isTrue);
+
+ var variableEnclosing = variable.enclosingElement;
+ if (variableEnclosing is CompilationUnitElement) {
+ expect(variableEnclosing.topLevelVariables, contains(variable));
+ } else if (variableEnclosing is ClassElement) {
+ expect(variableEnclosing.fields, contains(variable));
+ }
+
if (e.isGetter) {
expect(variable.getter, same(e));
if (variable.setter != null) {
@@ -730,7 +738,7 @@ class _ElementWriter {
expect(e.isAsynchronous, isFalse);
expect(e.isGenerator, isFalse);
- if (e.isAbstract) {
+ if (e.isAbstract || e.isExternal) {
buffer.writeln(';');
} else {
buffer.writeln(' {}');

Powered by Google App Engine
This is Rietveld 408576698