Fix import assertion occurrences crash and make import assertion parsing more generous (#47535)

This commit is contained in:
Wesley Wigham
2022-01-20 14:08:47 -08:00
committed by GitHub
parent 04d77fe900
commit bae0f50818
15 changed files with 154 additions and 14 deletions

View File

@@ -7281,7 +7281,7 @@ namespace ts {
const pos = getNodePos();
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(SyntaxKind.StringLiteral) as StringLiteral;
parseExpected(SyntaxKind.ColonToken);
const value = parseLiteralLikeNode(SyntaxKind.StringLiteral) as StringLiteral;
const value = parseAssignmentExpressionOrHigher();
return finishNode(factory.createAssertEntry(name, value), pos);
}