diff --git a/crates/swc_ecma_ast/src/expr.rs b/crates/swc_ecma_ast/src/expr.rs index 6d294b4652e6..1ffc1879ff7a 100644 --- a/crates/swc_ecma_ast/src/expr.rs +++ b/crates/swc_ecma_ast/src/expr.rs @@ -1462,9 +1462,9 @@ impl TryFrom> for AssignTarget { #[cfg_attr(feature = "shrink-to-fit", derive(shrink_to_fit::ShrinkToFit))] pub enum AssignTargetPat { #[tag("ArrayPattern")] - Array(ArrayPat), + Array(Box), #[tag("ObjectPattern")] - Object(ObjectPat), + Object(Box), #[tag("Invalid")] Invalid(Invalid), } @@ -1593,8 +1593,8 @@ bridge_from!(AssignTarget, SimpleAssignTarget, TsSatisfiesExpr); bridge_from!(AssignTarget, SimpleAssignTarget, TsNonNullExpr); bridge_from!(AssignTarget, SimpleAssignTarget, TsTypeAssertion); -bridge_from!(AssignTarget, AssignTargetPat, ArrayPat); -bridge_from!(AssignTarget, AssignTargetPat, ObjectPat); +bridge_from!(AssignTarget, AssignTargetPat, Box); +bridge_from!(AssignTarget, AssignTargetPat, Box); impl From for Box { fn from(s: SimpleAssignTarget) -> Self { diff --git a/crates/swc_ecma_ast/src/pat.rs b/crates/swc_ecma_ast/src/pat.rs index d33339e8f68c..d26b3613c5c6 100644 --- a/crates/swc_ecma_ast/src/pat.rs +++ b/crates/swc_ecma_ast/src/pat.rs @@ -18,13 +18,13 @@ pub enum Pat { Ident(BindingIdent), #[tag("ArrayPattern")] - Array(ArrayPat), + Array(Box), #[tag("RestElement")] Rest(RestPat), #[tag("ObjectPattern")] - Object(ObjectPat), + Object(Box), #[tag("AssignmentPattern")] Assign(AssignPat), @@ -77,8 +77,8 @@ macro_rules! pat_to_other { } pat_to_other!(BindingIdent); -pat_to_other!(ArrayPat); -pat_to_other!(ObjectPat); +pat_to_other!(Box); +pat_to_other!(Box); pat_to_other!(AssignPat); pat_to_other!(RestPat); pat_to_other!(Box);