support destructuring of catch variable (#4412)

This commit is contained in:
Alex Lam S.L
2020-12-19 12:28:38 +08:00
committed by GitHub
parent 0f55bd92f1
commit e6dd471f8f
5 changed files with 120 additions and 50 deletions

View File

@@ -1216,7 +1216,7 @@ function parse($TEXT, options) {
var name = null;
if (is("punc", "(")) {
next();
name = as_symbol(AST_SymbolCatch);
name = maybe_destructured(AST_SymbolCatch);
expect(")");
}
bcatch = new AST_Catch({