Merge pull request #17517 from tinganho/IgnoredCatchParameter

Ignored catch parameter
This commit is contained in:
Ron Buckton
2017-08-08 16:15:18 -07:00
committed by GitHub
21 changed files with 204 additions and 117 deletions

View File

@@ -4799,11 +4799,16 @@ namespace ts {
function parseCatchClause(): CatchClause {
const result = <CatchClause>createNode(SyntaxKind.CatchClause);
parseExpected(SyntaxKind.CatchKeyword);
if (parseExpected(SyntaxKind.OpenParenToken)) {
if (parseOptional(SyntaxKind.OpenParenToken)) {
result.variableDeclaration = parseVariableDeclaration();
parseExpected(SyntaxKind.CloseParenToken);
}
else {
// Keep shape of node to avoid degrading performance.
result.variableDeclaration = undefined;
}
parseExpected(SyntaxKind.CloseParenToken);
result.block = parseBlock(/*ignoreMissingOpenBrace*/ false);
return finishNode(result);
}