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

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

Issue 2966313002: Remove ExecutableElement.localVariables altogether. (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 cce2691bcaf2d3af01f4b6e63aada14174239545..66f6878c3074c8ebecc19345331624cf5d4ef60f 100644
--- a/pkg/analyzer/lib/src/summary/resynthesize.dart
+++ b/pkg/analyzer/lib/src/summary/resynthesize.dart
@@ -826,38 +826,6 @@ class _DeferredLocalFunctionElement extends FunctionElementHandle {
}
/**
- * Local variable 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 _DeferredLocalVariableElement extends LocalVariableElementHandle {
- /**
- * The executable element containing this element.
- */
- @override
- final ExecutableElement enclosingElement;
-
- /**
- * The index of this variable within [ExecutableElement.localVariables].
- */
- final int _localIndex;
-
- _DeferredLocalVariableElement(this.enclosingElement, this._localIndex)
- : super(null, null);
-
- @override
- LocalVariableElement get actualElement =>
- enclosingElement.localVariables[_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.
*/
@@ -1890,16 +1858,6 @@ class _UnitResynthesizer {
summaryResynthesizer, location);
isDeclarableType = true;
break;
- case ReferenceKind.variable:
- Element enclosingElement = enclosingInfo.element;
- if (enclosingElement is ExecutableElement) {
- element = new _DeferredLocalVariableElement(
- enclosingElement, linkedReference.localIndex);
- } else {
- throw new StateError('Unexpected element enclosing variable:'
- ' ${enclosingElement.runtimeType}');
- }
- break;
case ReferenceKind.function:
Element enclosingElement = enclosingInfo.element;
if (enclosingElement is VariableElement) {
@@ -1915,6 +1873,7 @@ class _UnitResynthesizer {
case ReferenceKind.prefix:
element = new PrefixElementHandle(summaryResynthesizer, location);
break;
+ case ReferenceKind.variable:
case ReferenceKind.unresolved:
break;
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/declaration_resolver.dart ('k') | pkg/analyzer/test/dart/element/builder_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698