Fix codegen for Optional Catch Binding
Closes
MODIFY
packages/@romejs/js-generator/generators/auxiliary/CatchClause.ts
packages/@romejs/js-generator/generators/auxiliary/CatchClause.ts
@@ -12,10 +12,12 @@ export default function CatchClause(generator: Generator, node: AnyNode) {
node = catchClause.assert(node);
catchClause.assert(node);
generator.word('catch');
+ if (node.param) {
generator.space();
generator.token('(');
generator.print(node.param, node);
generator.token(')');
+ }
generator.space();
generator.print(node.body, node);
}

Fix codegen for Optional Catch Binding

Closes #200