Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Sep 13, 2019
1 parent a653e20 commit ea6ed78
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/attachScopes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,4 +586,42 @@ describe('attachScopes', function() {
attachScopes(ast, 'scope');
}).not.toThrow();
});

it('supports catch without a parameter', function() {
const ast = {
"type": "Program",
"start": 0,
"end": 23,
"body": [
{
"type": "TryStatement",
"start": 0,
"end": 23,
"block": {
"type": "BlockStatement",
"start": 4,
"end": 10,
"body": []
},
"handler": {
"type": "CatchClause",
"start": 11,
"end": 23,
"param": null,
"body": {
"type": "BlockStatement",
"start": 17,
"end": 23,
"body": []
}
},
"finalizer": null
}
],
"sourceType": "script"
};
expect(() => {
attachScopes(ast, 'scope');
}).not.toThrow();
});
});

0 comments on commit ea6ed78

Please sign in to comment.