From 2541ab5fdae7c8fc262d5b4919b124584e0c4c75 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 22 May 2017 10:42:32 -0700 Subject: [PATCH] Simplify PrivateName and ClassPrivateProperty types (#532) * Simplify PrivateName and ClassPrivateProperty types * ClassPrivateProperty is not a ClassMemberBase; can't be static, can't be computed --- src/types.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/types.js b/src/types.js index 5e8013b5de..23597835fd 100644 --- a/src/types.js +++ b/src/types.js @@ -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 & {