File tree Expand file tree Collapse file tree 4 files changed +32
-22
lines changed
tests/fixture/issues/10466 Expand file tree Collapse file tree 4 files changed +32
-22
lines changed Original file line number Diff line number Diff line change @@ -2278,28 +2278,6 @@ impl VisitMut for Optimizer<'_> {
22782278 n. retain ( |p| !p. pat . is_invalid ( ) ) ;
22792279 }
22802280
2281- #[ cfg_attr( feature = "debug" , tracing:: instrument( level = "debug" , skip_all) ) ]
2282- fn visit_mut_prop ( & mut self , n : & mut Prop ) {
2283- n. visit_mut_children_with ( self ) ;
2284-
2285- if let Prop :: Shorthand ( i) = n {
2286- if self . vars . has_pending_inline_for ( & i. to_id ( ) ) {
2287- let mut e: Expr = i. clone ( ) . into ( ) ;
2288- e. visit_mut_with ( self ) ;
2289-
2290- * n = Prop :: KeyValue ( KeyValueProp {
2291- key : PropName :: Ident ( i. clone ( ) . into ( ) ) ,
2292- value : Box :: new ( e) ,
2293- } ) ;
2294- }
2295- }
2296-
2297- #[ cfg( debug_assertions) ]
2298- {
2299- n. visit_with ( & mut AssertValid ) ;
2300- }
2301- }
2302-
23032281 #[ cfg_attr( feature = "debug" , tracing:: instrument( level = "debug" , skip_all) ) ]
23042282 fn visit_mut_return_stmt ( & mut self , n : & mut ReturnStmt ) {
23052283 n. visit_mut_children_with ( self ) ;
Original file line number Diff line number Diff line change @@ -453,6 +453,20 @@ impl VisitMut for Finalizer<'_> {
453453
454454 n. retain ( |v| !v. name . is_invalid ( ) ) ;
455455 }
456+
457+ fn visit_mut_prop ( & mut self , n : & mut Prop ) {
458+ n. visit_mut_children_with ( self ) ;
459+
460+ if let Prop :: Shorthand ( i) = n {
461+ if let Some ( expr) = self . lits . get ( & i. to_id ( ) ) {
462+ * n = Prop :: KeyValue ( KeyValueProp {
463+ key : i. take ( ) . into ( ) ,
464+ value : expr. clone ( ) ,
465+ } ) ;
466+ self . changed = true ;
467+ }
468+ }
469+ }
456470}
457471
458472pub ( crate ) struct NormalMultiReplacer < ' a > {
Original file line number Diff line number Diff line change 1+ const G = {
2+ setPackageName ( { packageName } ) {
3+ if ( "string" == typeof packageName ) this . packageName = packageName ;
4+ return this ;
5+ }
6+ } ;
7+ var packageName ;
8+ packageName = "@clerk/clerk-react" , G . setPackageName ( {
9+ packageName
10+ } ) , console . log ( G . packageName ) ;
Original file line number Diff line number Diff line change 1+ const G = {
2+ setPackageName ( { packageName } ) {
3+ return "string" == typeof packageName && ( this . packageName = packageName ) , this ;
4+ }
5+ } ;
6+ G . setPackageName ( {
7+ packageName : "@clerk/clerk-react"
8+ } ) , console . log ( G . packageName ) ;
You can’t perform that action at this time.
0 commit comments