Skip asterisks after newline when parsing JSDoc types (#26528)

* Skip asterisks after newline when parsing JSDoc types

* Single boolean expression

* Test for parsing and printing multiline function signatures with *
This commit is contained in:
Tim Schaub
2018-09-04 16:41:08 -06:00
committed by Nathan Shively-Sanders
parent 64ac5a53f4
commit 262ea5b06e
8 changed files with 641 additions and 12 deletions

View File

@@ -2377,8 +2377,10 @@ namespace ts {
}
function parseJSDocType(): TypeNode {
scanner.setInJSDocType(true);
const dotdotdot = parseOptionalToken(SyntaxKind.DotDotDotToken);
let type = parseTypeOrTypePredicate();
scanner.setInJSDocType(false);
if (dotdotdot) {
const variadic = createNode(SyntaxKind.JSDocVariadicType, dotdotdot.pos) as JSDocVariadicType;
variadic.type = type;