File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed 
packages/svelte/src/compiler/phases/3-transform/client/visitors Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -144,9 +144,18 @@ export function Program(node, context) {
144144		const  chunk  =  context . state . parallelized_derived_chunks ?. at ( - 1 ) ; 
145145		body . push ( transformed ) ; 
146146		if  ( chunk  &&  chunk . position  ===  i )  { 
147- 			const  pattern  =  b . array_pattern ( chunk . declarators . map ( ( {  id } )  =>  id ) ) ; 
148- 			const  init  =  b . call ( '$.all' ,  b . array ( chunk . declarators . map ( ( {  init } )  =>  init ) ) ) ; 
149- 			body . push ( b . declaration ( chunk . kind ,  [ b . declarator ( pattern ,  b . await ( init ) ) ] ) ) ; 
147+ 			if  ( chunk . declarators . length  ===  1 )  { 
148+ 				const  declarator  =  chunk . declarators [ 0 ] ; 
149+ 				body . push ( 
150+ 					b . declaration ( chunk . kind ,  [ 
151+ 						b . declarator ( declarator . id ,  b . call ( b . await ( b . call ( '$.save' ,  declarator . init ) ) ) ) 
152+ 					] ) 
153+ 				) ; 
154+ 			}  else  { 
155+ 				const  pattern  =  b . array_pattern ( chunk . declarators . map ( ( {  id } )  =>  id ) ) ; 
156+ 				const  init  =  b . call ( '$.all' ,  b . array ( chunk . declarators . map ( ( {  init } )  =>  init ) ) ) ; 
157+ 				body . push ( b . declaration ( chunk . kind ,  [ b . declarator ( pattern ,  b . await ( init ) ) ] ) ) ; 
158+ 			} 
150159		} 
151160	} 
152161	return  { 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments