handle destructuring catch in --reduce-test (#4427)

This commit is contained in:
Alex Lam S.L
2020-12-20 03:22:45 +00:00
committed by GitHub
parent f5224ca1f5
commit caea6aac81
5 changed files with 32 additions and 2 deletions

View File

@@ -465,7 +465,7 @@ module.exports = function reduce_test(testcase, minify_options, reduce_options)
if (node.TYPE == "Call" && node.expression.print_to_string() == "console.log") {
return to_sequence(node.args);
}
if (node instanceof U.AST_Catch && node.argname) {
if (node instanceof U.AST_Catch && node.argname instanceof U.AST_SymbolCatch) {
descend(node, this);
node.body.unshift(new U.AST_SimpleStatement({
body: wrap_with_console_log(new U.AST_SymbolRef(node.argname)),