mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-15 22:15:05 -05:00
Merge pull request #17517 from tinganho/IgnoredCatchParameter
Ignored catch parameter
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user