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:
@@ -209,6 +209,22 @@ nodes.ObjectTypeIndexer = function(node: Object, parent): ?WhitespaceObject {
|
||||
}
|
||||
};
|
||||
|
||||
nodes.ObjectTypeInternalSlot = function(
|
||||
node: Object,
|
||||
parent,
|
||||
): ?WhitespaceObject {
|
||||
if (
|
||||
parent.internalSlots[0] === node &&
|
||||
(!parent.properties || !parent.properties.length) &&
|
||||
(!parent.callProperties || !parent.callProperties.length) &&
|
||||
(!parent.indexers || !parent.indexers.length)
|
||||
) {
|
||||
return {
|
||||
before: true,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns lists from node types that need whitespace.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user