Simplify PrivateName and ClassPrivateProperty types (#532)

* Simplify PrivateName and ClassPrivateProperty types

* ClassPrivateProperty is not a ClassMemberBase; can't be static, can't be computed
This commit is contained in:
Andy 2017-05-22 10:42:32 -07:00 committed by Henry Zhu
parent 01da62283c
commit 2541ab5fda

View File

@ -62,11 +62,9 @@ export type Identifier = PatternBase & {
__clone(): Identifier;
};
export type PrivateName = PatternBase & {
export type PrivateName = NodeBase & {
type: "PrivateName";
name: string;
__clone(): Identifier;
};
// Literals
@ -591,16 +589,10 @@ export type ClassProperty = ClassMemberBase & {
readonly?: true;
};
export type ClassPrivateProperty = ClassMemberBase & {
export type ClassPrivateProperty = NodeBase & {
type: "ClassPrivateProperty";
key: Identifier;
value: ?Expression; // TODO: Not in spec that this is nullable.
typeAnnotation?: ?FlowTypeAnnotation; // TODO: Not in spec
variance?: ?FlowVariance; // TODO: Not in spec
// TypeScript only: (TODO: Not in spec)
readonly?: true;
};
export type OptClassDeclaration = ClassBase & DeclarationBase & HasDecorators & {