Chromium Code Reviews| Index: lib/compiler/implementation/tree/nodes.dart |
| diff --git a/lib/compiler/implementation/tree/nodes.dart b/lib/compiler/implementation/tree/nodes.dart |
| index fff93e450b05f3ac76f218898bbfbd2c97a66121..42f51c5986f0a9c4a668cdffe295b6102bb6f678 100644 |
| --- a/lib/compiler/implementation/tree/nodes.dart |
| +++ b/lib/compiler/implementation/tree/nodes.dart |
| @@ -609,7 +609,9 @@ class FunctionExpression extends Expression { |
| final Token getOrSet; |
| FunctionExpression(this.name, this.parameters, this.body, this.returnType, |
| - this.modifiers, this.initializers, this.getOrSet); |
| + this.modifiers, this.initializers, this.getOrSet) { |
| + assert(modifiers !== null); |
| + } |
| FunctionExpression asFunctionExpression() => this; |
| @@ -994,7 +996,9 @@ class VariableDefinitions extends Statement { |
| final Modifiers modifiers; |
| final NodeList definitions; |
| VariableDefinitions(this.type, this.modifiers, this.definitions, |
| - this.endToken); |
| + this.endToken) { |
| + assert(modifiers !== null); |
| + } |
| VariableDefinitions asVariableDefinitions() => this; |
| @@ -1093,6 +1097,11 @@ class ParenthesizedExpression extends Expression { |
| /** Representation of modifiers such as static, abstract, final, etc. */ |
| class Modifiers extends Node { |
| + /** |
| + * Pseudo-constant for empty modifiers. Use this instead of null. |
|
floitsch
2012/10/01 09:02:59
Remove "Use this instead of null".
Johnni Winther
2012/10/01 09:12:11
Why?
|
| + */ |
| + static final Modifiers EMPTY = new Modifiers(new NodeList.empty()); |
| + |
| /* TODO(ahe): The following should be validated relating to modifiers: |
| * 1. The nodes must come in a certain order. |
| * 2. The keywords "var" and "final" may not be used at the same time. |
| @@ -1114,8 +1123,6 @@ class Modifiers extends Node { |
| Modifiers(NodeList nodes) : this.withFlags(nodes, computeFlags(nodes.nodes)); |
| - Modifiers.empty() : this(new NodeList.empty()); |
| - |
| Modifiers.withFlags(this.nodes, this.flags); |
| static int computeFlags(Link<Node> nodes) { |