From 8856ddfd15e51ffe9901dd17255127ee0b6b9ca6 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Tue, 11 Jul 2017 10:45:25 -0700 Subject: [PATCH] Make enum private and fix fillSignature predicate --- src/compiler/parser.ts | 9 ++++++++- src/compiler/types.ts | 7 ------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 74adccae08..8608245cfc 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2,6 +2,13 @@ /// namespace ts { + const enum SignatureContext { + Yield = 1 << 0, + Await = 1 << 1, + Type = 1 << 2, + RequireCompleteParameterList = 1 << 3, + } + let NodeConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node; let TokenConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node; let IdentifierConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node; @@ -2231,7 +2238,7 @@ namespace ts { else if (parseOptional(returnToken)) { signature.type = parseTypeOrTypePredicate(); } - else if (context === SignatureContext.Type) { + else if (context & SignatureContext.Type) { const start = scanner.getTokenPos(); const length = scanner.getTextPos() - start; const backwardToken = parseOptional(returnToken === SyntaxKind.ColonToken ? SyntaxKind.EqualsGreaterThanToken : SyntaxKind.ColonToken); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index eb4fac52b7..aefcce6d0b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -36,13 +36,6 @@ namespace ts { end: number; } - export const enum SignatureContext { - Yield = 1 << 1, - Await = 1 << 2, - Type = 1 << 3, - RequireCompleteParameterList = 1 << 4, - } - // token > SyntaxKind.Identifer => token is a keyword // Also, If you add a new SyntaxKind be sure to keep the `Markers` section at the bottom in sync export const enum SyntaxKind {