Make enum private and fix fillSignature predicate

This commit is contained in:
Nathan Shively-Sanders 2017-07-11 10:45:25 -07:00
parent 3638ff19b3
commit 8856ddfd15
2 changed files with 8 additions and 8 deletions

View file

@ -2,6 +2,13 @@
/// <reference path="scanner.ts"/>
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);

View file

@ -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 {