mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 02:06:08 +03:00
Fix typescript stripper (#905)
swc_ecma_codegen: - Fix codegen of optional catch parameters (#904) swc_ecma_transforms: - Fix for nested catch clause
This commit is contained in:
parent
c58b9c8649
commit
891092caf2
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "swc_ecma_codegen"
|
||||
version = "0.28.2"
|
||||
version = "0.28.3"
|
||||
authors = ["강동윤 <kdy1997.dev@gmail.com>"]
|
||||
license = "Apache-2.0/MIT"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
|
@ -1986,9 +1986,11 @@ impl<'a> Emitter<'a> {
|
||||
keyword!("catch");
|
||||
formatting_space!();
|
||||
|
||||
punct!("(");
|
||||
emit!(node.param);
|
||||
punct!(")");
|
||||
if let Some(param) = &node.param {
|
||||
punct!("(");
|
||||
emit!(param);
|
||||
punct!(")");
|
||||
}
|
||||
|
||||
space!();
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "swc_ecma_transforms"
|
||||
version = "0.15.1"
|
||||
version = "0.15.2"
|
||||
authors = ["강동윤 <kdy1997.dev@gmail.com>"]
|
||||
license = "Apache-2.0/MIT"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
|
@ -1,5 +1,5 @@
|
||||
use swc_ecma_ast::*;
|
||||
use swc_ecma_visit::Fold;
|
||||
use swc_ecma_visit::{Fold, FoldWith};
|
||||
|
||||
struct OptionalCatchBinding;
|
||||
|
||||
@ -10,7 +10,9 @@ pub fn optional_catch_binding() -> impl Fold {
|
||||
}
|
||||
|
||||
impl Fold for OptionalCatchBinding {
|
||||
fn fold_catch_clause(&mut self, cc: CatchClause) -> CatchClause {
|
||||
fn fold_catch_clause(&mut self, mut cc: CatchClause) -> CatchClause {
|
||||
cc = cc.fold_children_with(self);
|
||||
|
||||
if cc.param.is_some() {
|
||||
return cc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user