Chromium Code Reviews| 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 0531a73146c188b08eaa188d423d28b1fa93db1f..37df41a0d34a872c5431628f25d1d93707b33359 100644 |
| --- a/pkg/compiler/lib/src/elements/modelx.dart |
| +++ b/pkg/compiler/lib/src/elements/modelx.dart |
| @@ -299,6 +299,7 @@ class ErroneousElementX extends ElementX implements ErroneousElement { |
| get type => unsupported(); |
| get cachedNode => unsupported(); |
| get functionSignature => unsupported(); |
| + get parameters => unsupported(); |
| get patch => null; |
| get origin => this; |
| get immediateRedirectionTarget => unsupported(); |
| @@ -1532,12 +1533,16 @@ class FormalElementX extends ElementX |
| abstract class ParameterElementX extends FormalElementX |
| with PatchMixin<ParameterElement> implements ParameterElement { |
| final Expression initializer; |
| + final bool isOptional; |
| + final bool isNamed; |
| ParameterElementX(ElementKind elementKind, |
| FunctionElement functionDeclaration, |
| VariableDefinitions definitions, |
| Identifier identifier, |
| - this.initializer) |
| + this.initializer, |
| + {this.isOptional: false, |
| + this.isNamed: false}) |
| : super(elementKind, functionDeclaration, definitions, identifier); |
| FunctionElement get functionDeclaration => enclosingElement; |
| @@ -1553,12 +1558,17 @@ abstract class ParameterElementX extends FormalElementX |
| class LocalParameterElementX extends ParameterElementX |
| implements LocalParameterElement { |
| + |
| + |
| LocalParameterElementX(FunctionElement functionDeclaration, |
| VariableDefinitions definitions, |
| Identifier identifier, |
| - Expression initializer) |
| + Expression initializer, |
| + {bool isOptional: false, |
| + bool isNamed: false}) |
| : super(ElementKind.PARAMETER, functionDeclaration, |
| - definitions, identifier, initializer); |
| + definitions, identifier, initializer, |
| + isOptional: isOptional, isNamed: isNamed); |
| } |
| /// Parameters in constructors that directly initialize fields. For example: |
| @@ -1571,9 +1581,12 @@ class InitializingFormalElementX extends ParameterElementX |
| VariableDefinitions variables, |
| Identifier identifier, |
| Expression initializer, |
| - this.fieldElement) |
| + this.fieldElement, |
| + {bool isOptional: false, |
| + bool isNamed: false}) |
| : super(ElementKind.INITIALIZING_FORMAL, constructorDeclaration, |
| - variables, identifier, initializer); |
| + variables, identifier, initializer, |
| + isOptional: isOptional, isNamed: isNamed); |
| accept(ElementVisitor visitor) => visitor.visitFieldParameterElement(this); |
| @@ -1806,6 +1819,12 @@ abstract class BaseFunctionElementX |
| return functionSignatureCache; |
| } |
| + List<ParameterElement> get parameters { |
|
herhut
2015/01/28 14:12:50
Does this have to be a List or would an Iterable d
Johnni Winther
2015/01/29 07:51:07
Adding a TODO to store the list directly while rem
|
| + List<ParameterElement> list = <ParameterElement>[]; |
| + functionSignature.forEachParameter((e) => list.add(e)); |
| + return list; |
| + } |
| + |
| FunctionType computeType(Compiler compiler) { |
| if (typeCache != null) return typeCache; |
| typeCache = computeSignature(compiler).type; |