Skip to content

Commit 8856ddf

Browse files
committed
Make enum private and fix fillSignature predicate
1 parent 3638ff1 commit 8856ddf

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/compiler/parser.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
/// <reference path="scanner.ts"/>
33

44
namespace ts {
5+
const enum SignatureContext {
6+
Yield = 1 << 0,
7+
Await = 1 << 1,
8+
Type = 1 << 2,
9+
RequireCompleteParameterList = 1 << 3,
10+
}
11+
512
let NodeConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node;
613
let TokenConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node;
714
let IdentifierConstructor: new (kind: SyntaxKind, pos: number, end: number) => Node;
@@ -2231,7 +2238,7 @@ namespace ts {
22312238
else if (parseOptional(returnToken)) {
22322239
signature.type = parseTypeOrTypePredicate();
22332240
}
2234-
else if (context === SignatureContext.Type) {
2241+
else if (context & SignatureContext.Type) {
22352242
const start = scanner.getTokenPos();
22362243
const length = scanner.getTextPos() - start;
22372244
const backwardToken = parseOptional(returnToken === SyntaxKind.ColonToken ? SyntaxKind.EqualsGreaterThanToken : SyntaxKind.ColonToken);

src/compiler/types.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ namespace ts {
3636
end: number;
3737
}
3838

39-
export const enum SignatureContext {
40-
Yield = 1 << 1,
41-
Await = 1 << 2,
42-
Type = 1 << 3,
43-
RequireCompleteParameterList = 1 << 4,
44-
}
45-
4639
// token > SyntaxKind.Identifer => token is a keyword
4740
// Also, If you add a new SyntaxKind be sure to keep the `Markers` section at the bottom in sync
4841
export const enum SyntaxKind {

0 commit comments

Comments
 (0)