Add ObjectMember abstract type
This commit is contained in:
parent
5c1d2ab92f
commit
86287a7a8c
@ -53,8 +53,9 @@ This document specifies the core ESTree AST node types that support the ES5 gram
|
|||||||
- [AwaitExpression](#awaitexpression)
|
- [AwaitExpression](#awaitexpression)
|
||||||
- [ArrayExpression](#arrayexpression)
|
- [ArrayExpression](#arrayexpression)
|
||||||
- [ObjectExpression](#objectexpression)
|
- [ObjectExpression](#objectexpression)
|
||||||
- [ObjectProperty](#objectproperty)
|
- [ObjectMember](#objectmember)
|
||||||
- [ObjectMethod](#objectmethod)
|
- [ObjectProperty](#objectproperty)
|
||||||
|
- [ObjectMethod](#objectmethod)
|
||||||
- [RestProperty](#restproperty)
|
- [RestProperty](#restproperty)
|
||||||
- [SpreadProperty](#spreadproperty)
|
- [SpreadProperty](#spreadproperty)
|
||||||
- [FunctionExpression](#functionexpression)
|
- [FunctionExpression](#functionexpression)
|
||||||
@ -631,29 +632,32 @@ interface ObjectExpression <: Expression {
|
|||||||
|
|
||||||
An object expression.
|
An object expression.
|
||||||
|
|
||||||
### ObjectProperty
|
### ObjectMember
|
||||||
|
|
||||||
```js
|
```js
|
||||||
interface ObjectProperty <: Node {
|
interface ObjectMember <: Node {
|
||||||
type: "ObjectProperty";
|
|
||||||
key: Expression;
|
key: Expression;
|
||||||
computed: boolean;
|
computed: boolean;
|
||||||
value: Expression;
|
value: Expression;
|
||||||
shorthand: boolean;
|
|
||||||
decorators: [ Decorator ];
|
decorators: [ Decorator ];
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### ObjectMethod
|
#### ObjectProperty
|
||||||
|
|
||||||
```js
|
```js
|
||||||
interface ObjectMethod <: Function {
|
interface ObjectProperty <: ObjectMember {
|
||||||
|
type: "ObjectProperty";
|
||||||
|
shorthand: boolean;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### ObjectMethod
|
||||||
|
|
||||||
|
```js
|
||||||
|
interface ObjectMethod <: ObjectMember, Function {
|
||||||
type: "ObjectMethod";
|
type: "ObjectMethod";
|
||||||
key: Expression;
|
|
||||||
computed: boolean;
|
|
||||||
value: Expression;
|
|
||||||
kind: "get" | "set" | "method";
|
kind: "get" | "set" | "method";
|
||||||
decorators: [ Decorator ];
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -498,7 +498,7 @@ defineType("ObjectMethod", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
|
visitor: ["key", "params", "body", "decorators", "returnType", "typeParameters"],
|
||||||
aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method"]
|
aliases: ["UserWhitespacable", "Function", "Scopable", "BlockParent", "FunctionParent", "Method", "ObjectMember"]
|
||||||
});
|
});
|
||||||
|
|
||||||
defineType("ObjectProperty", {
|
defineType("ObjectProperty", {
|
||||||
@ -527,7 +527,7 @@ defineType("ObjectProperty", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
visitor: ["key", "value", "decorators"],
|
visitor: ["key", "value", "decorators"],
|
||||||
aliases: ["UserWhitespacable", "Property"]
|
aliases: ["UserWhitespacable", "Property", "ObjectMember"]
|
||||||
});
|
});
|
||||||
|
|
||||||
defineType("RestElement", {
|
defineType("RestElement", {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user