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,10 +526,7 @@ impl<'a> VisitMut for CompilerImpl<'a> {
526
526
}
527
527
528
528
fn visit_mut_expr ( & mut self , e : & mut Expr ) {
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
529
+ // Phase 1: Pre-processing - Check and apply transformations that replace the
533
530
// expression
534
531
let logical_transformed = self . config . includes . contains ( Features :: LOGICAL_ASSIGNMENTS )
535
532
&& self . transform_logical_assignment ( e) ;
@@ -539,13 +536,16 @@ impl<'a> VisitMut for CompilerImpl<'a> {
539
536
&& ( self . transform_nullish_coalescing_bin_expr ( e)
540
537
|| self . transform_nullish_coalescing_assign_expr ( e) ) ;
541
538
542
- // Phase 3 : Setup for private field expressions
539
+ // Phase 2 : Setup for private field expressions
543
540
let prev_prepend_exprs = if self . config . includes . contains ( Features :: PRIVATE_IN_OBJECT ) {
544
541
Some ( take ( & mut self . es2022_private_field_init_exprs ) )
545
542
} else {
546
543
None
547
544
} ;
548
545
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