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

Commit ea6ed78

Browse files
committed
Add test
1 parent a653e20 commit ea6ed78

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

test/attachScopes.test.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,4 +586,42 @@ describe('attachScopes', function() {
586586
attachScopes(ast, 'scope');
587587
}).not.toThrow();
588588
});
589+
590+
it('supports catch without a parameter', function() {
591+
const ast = {
592+
"type": "Program",
593+
"start": 0,
594+
"end": 23,
595+
"body": [
596+
{
597+
"type": "TryStatement",
598+
"start": 0,
599+
"end": 23,
600+
"block": {
601+
"type": "BlockStatement",
602+
"start": 4,
603+
"end": 10,
604+
"body": []
605+
},
606+
"handler": {
607+
"type": "CatchClause",
608+
"start": 11,
609+
"end": 23,
610+
"param": null,
611+
"body": {
612+
"type": "BlockStatement",
613+
"start": 17,
614+
"end": 23,
615+
"body": []
616+
}
617+
},
618+
"finalizer": null
619+
}
620+
],
621+
"sourceType": "script"
622+
};
623+
expect(() => {
624+
attachScopes(ast, 'scope');
625+
}).not.toThrow();
626+
});
589627
});

0 commit comments

Comments
 (0)