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

Unified Diff: pkg/analyzer/lib/src/summary/resynthesize.dart

Issue 2974803002: Store FunctionType(s) of local functions by value. (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/lib/src/summary/resynthesize.dart
diff --git a/pkg/analyzer/lib/src/summary/resynthesize.dart b/pkg/analyzer/lib/src/summary/resynthesize.dart
index 66f6878c3074c8ebecc19345331624cf5d4ef60f..4f90ec26a82629da9ac8c3ff559ef79512c97504 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -787,45 +787,6 @@ class _DeferredInitializerElement extends FunctionElementHandle {
}
/**
- * Local function element that has been resynthesized from a summary. The
- * actual element won't be constructed until it is requested. But properties
- * [context] and [enclosingElement] can be used without creating the actual
- * element.
- */
-class _DeferredLocalFunctionElement extends FunctionElementHandle {
- /**
- * The executable element containing this element.
- */
- @override
- final ExecutableElement enclosingElement;
-
- /**
- * The index of this function within [ExecutableElement.functions].
- */
- final int _localIndex;
-
- _DeferredLocalFunctionElement(this.enclosingElement, this._localIndex)
- : super(null, null);
-
- @override
- FunctionElement get actualElement {
- ExecutableElement enclosingElement = this.enclosingElement;
- if (enclosingElement is PropertyAccessorElement &&
- enclosingElement.isSynthetic) {
- return enclosingElement.variable.initializer;
- } else {
- return enclosingElement.functions[_localIndex];
- }
- }
-
- @override
- AnalysisContext get context => enclosingElement.context;
-
- @override
- ElementLocation get location => actualElement.location;
-}
-
-/**
* An instance of [_LibraryResynthesizer] is responsible for resynthesizing the
* elements in a single library from that library's summary.
*/
@@ -1862,9 +1823,6 @@ class _UnitResynthesizer {
Element enclosingElement = enclosingInfo.element;
if (enclosingElement is VariableElement) {
element = new _DeferredInitializerElement(enclosingElement);
- } else if (enclosingElement is ExecutableElement) {
- element = new _DeferredLocalFunctionElement(
- enclosingElement, linkedReference.localIndex);
} else {
throw new StateError('Unexpected element enclosing function:'
' ${enclosingElement.runtimeType}');

Powered by Google App Engine
This is Rietveld 408576698