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

Unified Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 1967073002: Check closure data for serialization (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. 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 | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/elements/modelx.dart
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index 74ac6ad33fbd8ce3c2e1ba3d1340d000cceff410..67518aea572111b994efe62983c54b3e8203119e 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -2284,18 +2284,30 @@ class DeferredLoaderGetterElementX extends GetterElementX
class ConstructorBodyElementX extends BaseFunctionElementX
implements ConstructorBodyElement {
- ConstructorElementX constructor;
+ final ResolvedAst _resolvedAst;
+ final ConstructorElement constructor;
- ConstructorBodyElementX(ConstructorElementX constructor)
- : this.constructor = constructor,
+ ConstructorBodyElementX(
+ ResolvedAst resolvedAst, ConstructorElement constructor)
+ : this._resolvedAst = resolvedAst,
+ this.constructor = constructor,
super(constructor.name, ElementKind.GENERATIVE_CONSTRUCTOR_BODY,
Modifiers.EMPTY, constructor.enclosingElement) {
functionSignature = constructor.functionSignature;
}
- bool get hasNode => constructor.hasNode;
+ bool get hasNode => _resolvedAst.kind == ResolvedAstKind.PARSED;
- FunctionExpression get node => constructor.node;
+ FunctionExpression get node => _resolvedAst.node;
+
+ ResolvedAst get resolvedAst {
+ if (_resolvedAst.kind == ResolvedAstKind.PARSED) {
+ return new ParsedResolvedAst(declaration, _resolvedAst.node,
+ _resolvedAst.body, _resolvedAst.elements, _resolvedAst.sourceUri);
+ } else {
+ return new SynthesizedResolvedAst(declaration, _resolvedAst.kind);
+ }
+ }
List<MetadataAnnotation> get metadata => constructor.metadata;
@@ -2307,6 +2319,8 @@ class ConstructorBodyElementX extends BaseFunctionElementX
return null;
}
+ int get sourceOffset => constructor.sourceOffset;
+
Token get position => constructor.position;
Element get outermostEnclosingMemberOrTopLevel => constructor;
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698