Internal slot properties (#7947)
* Support internalSlots to babel-types and babel-generator * Parsing support for internal slot properties * Print internal slots in babel-generator * Add whitespace before first internal slot property
This commit is contained in:
@@ -384,6 +384,7 @@ export function ObjectTypeAnnotation(node: Object) {
|
||||
const props = node.properties.concat(
|
||||
node.callProperties || [],
|
||||
node.indexers || [],
|
||||
node.internalSlots || [],
|
||||
);
|
||||
|
||||
if (props.length) {
|
||||
@@ -413,6 +414,23 @@ export function ObjectTypeAnnotation(node: Object) {
|
||||
}
|
||||
}
|
||||
|
||||
export function ObjectTypeInternalSlot(node: Object) {
|
||||
if (node.static) {
|
||||
this.word("static");
|
||||
this.space();
|
||||
}
|
||||
this.token("[");
|
||||
this.token("[");
|
||||
this.print(node.id, node);
|
||||
this.token("]");
|
||||
this.token("]");
|
||||
if (!node.method) {
|
||||
this.token(":");
|
||||
this.space();
|
||||
}
|
||||
this.print(node.value, node);
|
||||
}
|
||||
|
||||
export function ObjectTypeCallProperty(node: Object) {
|
||||
if (node.static) {
|
||||
this.word("static");
|
||||
|
||||
Reference in New Issue
Block a user