Use switch instead of instatating an array and when looking inside a module
This commit is contained in:
parent
77cdca2971
commit
5294e92d27
|
@ -2434,10 +2434,17 @@ namespace ts {
|
|||
const moduleSpecifier = parseOptionalToken(SyntaxKind.ModuleKeyword);
|
||||
if (moduleSpecifier) {
|
||||
const moduleTag = createNode(SyntaxKind.JSDocNamepathType, moduleSpecifier.pos) as JSDocNamepathType;
|
||||
const terminators = [SyntaxKind.CloseBraceToken, SyntaxKind.EndOfFileToken, SyntaxKind.CommaToken, SyntaxKind.CloseParenToken, SyntaxKind.WhitespaceTrivia];
|
||||
while (terminators.indexOf(token()) < 0) {
|
||||
terminate: while (true) {
|
||||
switch (token()) {
|
||||
case SyntaxKind.CloseBraceToken:
|
||||
case SyntaxKind.EndOfFileToken:
|
||||
case SyntaxKind.CommaToken:
|
||||
case SyntaxKind.WhitespaceTrivia:
|
||||
break terminate;
|
||||
default:
|
||||
nextTokenJSDoc();
|
||||
}
|
||||
}
|
||||
|
||||
scanner.setInJSDocType(false);
|
||||
return finishNode(moduleTag);
|
||||
|
|
Loading…
Reference in a new issue