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

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2026123003: Remove buildTopLevelFunctions() and resynthesize top-level functions directly. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 847c0125db29c8a740e10f1ee3ef164e1d6eda1f..ef327fd4d0d06661bdf863c38a1c5fdb577ab218 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -1269,9 +1269,12 @@ class CompilationUnitElementImpl extends UriReferencedElementImpl
@override
List<FunctionElement> get functions {
if (_unlinkedUnit != null) {
- _functions ??= resynthesizerContext.buildTopLevelFunctions();
+ _functions ??= _unlinkedUnit.executables
+ .where((e) => e.kind == UnlinkedExecutableKind.functionOrMethod)
+ .map((e) => new FunctionElementImpl.forSerialized(e, this))
+ .toList(growable: false);
}
- return _functions ?? FunctionElement.EMPTY_LIST;
+ return _functions ?? const <FunctionElement>[];
}
/**
@@ -7031,11 +7034,6 @@ abstract class ResynthesizerContext {
UnitExplicitTopLevelAccessors buildTopLevelAccessors();
/**
- * Build top-level functions.
- */
- List<FunctionElementImpl> buildTopLevelFunctions();
-
- /**
* Build explicit top-level variables.
*/
UnitExplicitTopLevelVariables buildTopLevelVariables();
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698