File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
crates/swc_ecma_compiler/src Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -526,7 +526,10 @@ impl<'a> VisitMut for CompilerImpl<'a> {
526526 }
527527
528528 fn visit_mut_expr ( & mut self , e : & mut Expr ) {
529- // Phase 1: Pre-processing - Check and apply transformations that replace the
529+ // Phase 1: Process children first to handle nested patterns
530+ e. visit_mut_children_with ( self ) ;
531+
532+ // Phase 2: Pre-processing - Check and apply transformations that replace the
530533 // expression
531534 let logical_transformed = self . config . includes . contains ( Features :: LOGICAL_ASSIGNMENTS )
532535 && self . transform_logical_assignment ( e) ;
@@ -536,16 +539,13 @@ impl<'a> VisitMut for CompilerImpl<'a> {
536539 && ( self . transform_nullish_coalescing_bin_expr ( e)
537540 || self . transform_nullish_coalescing_assign_expr ( e) ) ;
538541
539- // Phase 2 : Setup for private field expressions
542+ // Phase 3 : Setup for private field expressions
540543 let prev_prepend_exprs = if self . config . includes . contains ( Features :: PRIVATE_IN_OBJECT ) {
541544 Some ( take ( & mut self . es2022_private_field_init_exprs ) )
542545 } else {
543546 None
544547 } ;
545548
546- // Phase 3: Single recursive visit
547- e. visit_mut_children_with ( self ) ;
548-
549549 // Phase 4: Post-processing transformations
550550 // Handle private field expressions
551551 if let Some ( prev_prepend_exprs) = prev_prepend_exprs {
You can’t perform that action at this time.
0 commit comments