Add ObjectMember abstract type

This commit is contained in:
James Kyle 2015-11-24 15:00:04 -08:00
parent 5c1d2ab92f
commit 86287a7a8c
2 changed files with 18 additions and 14 deletions

View File

@ -53,8 +53,9 @@ This document specifies the core ESTree AST node types that support the ES5 gram
- [AwaitExpression](#awaitexpression)
- [ArrayExpression](#arrayexpression)
- [ObjectExpression](#objectexpression)
- [ObjectProperty](#objectproperty)
- [ObjectMethod](#objectmethod)
- [ObjectMember](#objectmember)
- [ObjectProperty](#objectproperty)
- [ObjectMethod](#objectmethod)
- [RestProperty](#restproperty)
- [SpreadProperty](#spreadproperty)
- [FunctionExpression](#functionexpression)
@ -631,29 +632,32 @@ interface ObjectExpression <: Expression {
An object expression.
### ObjectProperty
### ObjectMember
```js
interface ObjectProperty <: Node {
type: "ObjectProperty";
interface ObjectMember <: Node {
key: Expression;
computed: boolean;
value: Expression;
shorthand: boolean;
decorators: [ Decorator ];
}
```
### ObjectMethod
#### ObjectProperty
```js
interface ObjectMethod <: Function {
interface ObjectProperty <: ObjectMember {
type: "ObjectProperty";
shorthand: boolean;
}
```
#### ObjectMethod
```js
interface ObjectMethod <: ObjectMember, Function {
type: "ObjectMethod";
key: Expression;
computed: boolean;
value: Expression;
kind: "get" | "set" | "method";
decorators: [ Decorator ];
}
```

View File

@ -498,7 +498,7 @@ defineType("ObjectMethod", {
}
},
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method"]
aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
});
defineType("ObjectProperty", {
@ -527,7 +527,7 @@ defineType("ObjectProperty", {
}
},
visitor: ["key", "value", "decorators"],
aliases: ["UserWhitespacable", "Property"]
aliases: ["UserWhitespacable", "Property", "ObjectMember"]
});
defineType("RestElement", {