Skip to content

Commit

Permalink
feat(typescript-estree): allow catch clause to have a type
Browse files Browse the repository at this point in the history
  • Loading branch information
phiresky committed Jun 10, 2020
1 parent ee9f100 commit d0e242c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/typescript-estree/src/ast-converter.ts
Expand Up @@ -40,10 +40,10 @@ export function astConverter(
simpleTraverse(estree, {
enter: node => {
if (!extra.range) {
delete node.range;
delete (node as any).range;
}
if (!extra.loc) {
delete node.loc;
delete (node as any).loc;
}
},
});
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-estree/src/convert.ts
Expand Up @@ -697,7 +697,7 @@ export class Converter {
return this.createNode<TSESTree.CatchClause>(node, {
type: AST_NODE_TYPES.CatchClause,
param: node.variableDeclaration
? this.convertChild(node.variableDeclaration.name)
? this.convertChild(node.variableDeclaration).id
: null,
body: this.convertChild(node.block),
});
Expand Down

0 comments on commit d0e242c

Please sign in to comment.