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; |