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

Unified Diff: pkg/compiler/lib/src/serialization/modelz.dart

Issue 2124773002: Support enclosingClass on deserialized local elements (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Check local functions from implementation. Created 4 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
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/model_test_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/modelz.dart
diff --git a/pkg/compiler/lib/src/serialization/modelz.dart b/pkg/compiler/lib/src/serialization/modelz.dart
index e0c60ba8b9a130cff42fcc1f4d91efb91440b61d..ea6752aad9bf045a3f46539153a0e65459164e74 100644
--- a/pkg/compiler/lib/src/serialization/modelz.dart
+++ b/pkg/compiler/lib/src/serialization/modelz.dart
@@ -1500,6 +1500,8 @@ class ForwardingConstructorElementZ extends ElementZ
abstract class MemberElementMixin
implements DeserializedElementZ, MemberElement {
+ final List<FunctionElement> nestedClosures = <FunctionElement>[];
+
@override
MemberElement get memberContext => this;
@@ -1507,10 +1509,12 @@ abstract class MemberElementMixin
Name get memberName => new Name(name, library);
@override
- List<FunctionElement> get nestedClosures => <FunctionElement>[];
+ bool get isInjected => _decoder.getBool(Key.IS_INJECTED);
@override
- bool get isInjected => _decoder.getBool(Key.IS_INJECTED);
+ void forgetElement() {
+ nestedClosures.clear();
+ }
}
abstract class FieldElementZ extends DeserializedElementZ
@@ -1637,6 +1641,9 @@ abstract class LocalExecutableMixin
Element get enclosingElement => executableContext;
@override
+ Element get enclosingClass => memberContext.enclosingClass;
+
+ @override
ExecutableElement get executableContext {
if (_executableContext == null) {
_executableContext = _decoder.getElement(Key.EXECUTABLE_CONTEXT);
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/model_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698