retrofit try-catch-finally as block-scoped (#4178)
- support optional catch binding
This commit is contained in:
@@ -427,7 +427,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) {
|
||||
if (node instanceof U.AST_Catch && node.argname) {
|
||||
descend(node, this);
|
||||
node.body.unshift(new U.AST_SimpleStatement({
|
||||
body: wrap_with_console_log(new U.AST_SymbolRef(node.argname)),
|
||||
|
||||
Reference in New Issue
Block a user