@@ -9,7 +9,7 @@ part 'ast_visitor.dart';
99abstract class Node {
1010 /// The parent of this node, or null if this is the [Program] node.
1111 ///
12- /// If you transform the AST in any way, it is your own responsibility to update pointer pointers accordingly.
12+ /// If you transform the AST in any way, it is your own responsibility to update parent pointers accordingly.
1313 Node parent;
1414
1515 /// Source-code offset.
@@ -149,8 +149,6 @@ class Name extends Node {
149149 visitBy (Visitor v) => v.visitName (this );
150150}
151151
152- ///// STATEMENTS /////
153-
154152/// Superclass for all nodes that are statements.
155153abstract class Statement extends Node {}
156154
@@ -547,10 +545,17 @@ class ObjectExpression extends Expression {
547545}
548546
549547/// Property initializer `[key]: [value]` , or getter `get [key] [value]` , or setter `set [key] [value]` .
548+ ///
549+ /// For getters and setters, [value] is a [FunctionNode] , otherwise it is an [Expression] .
550550class Property extends Node {
551- Node key; // Literal or Name
552- Node value; // Will be FunctionNode with no name for getters and setters
553- String kind; // May be: init, get, set
551+ /// Literal or Name indicating the name of the property. Use [nameString] to get the name as a string.
552+ Node key;
553+
554+ /// A [FunctionNode] (for getters and setters) or an [Expression] (for ordinary properties).
555+ Node value;
556+
557+ /// May be "init", "get", or "set".
558+ String kind;
554559
555560 Property (this .key, this .value, [this .kind = 'init' ]);
556561 Property .getter (this .key, FunctionExpression this .value) : kind = 'get' ;
0 commit comments