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> {
526
526
}
527
527
528
528
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
530
533
// expression
531
534
let logical_transformed = self . config . includes . contains ( Features :: LOGICAL_ASSIGNMENTS )
532
535
&& self . transform_logical_assignment ( e) ;
@@ -536,16 +539,13 @@ impl<'a> VisitMut for CompilerImpl<'a> {
536
539
&& ( self . transform_nullish_coalescing_bin_expr ( e)
537
540
|| self . transform_nullish_coalescing_assign_expr ( e) ) ;
538
541
539
- // Phase 2 : Setup for private field expressions
542
+ // Phase 3 : Setup for private field expressions
540
543
let prev_prepend_exprs = if self . config . includes . contains ( Features :: PRIVATE_IN_OBJECT ) {
541
544
Some ( take ( & mut self . es2022_private_field_init_exprs ) )
542
545
} else {
543
546
None
544
547
} ;
545
548
546
- // Phase 3: Single recursive visit
547
- e. visit_mut_children_with ( self ) ;
548
-
549
549
// Phase 4: Post-processing transformations
550
550
// Handle private field expressions
551
551
if let Some ( prev_prepend_exprs) = prev_prepend_exprs {
You can’t perform that action at this time.
0 commit comments