File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
packages/svelte/src/internal/client/reactivity Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ export function legacy_rest_props(props, exclude) {
166166 */
167167const spread_props_handler = {
168168 get ( target , key ) {
169- if ( target . destroyed && key in target . oldProps ) return target . oldProps [ key ]
169+ if ( target . destroyed && key in target . oldProps ) return target . oldProps [ key ] ;
170170 let i = target . props . length ;
171171 while ( i -- ) {
172172 let p = target . props [ i ] ;
@@ -181,7 +181,7 @@ const spread_props_handler = {
181181 if ( is_function ( p ) ) p = p ( ) ;
182182 const desc = get_descriptor ( p , key ) ;
183183 if ( desc && desc . set ) {
184- desc . set ( target . oldProps [ key ] = value ) ;
184+ desc . set ( ( target . oldProps [ key ] = value ) ) ;
185185 return true ;
186186 }
187187 }
@@ -241,9 +241,20 @@ const spread_props_handler = {
241241 * @returns {any }
242242 */
243243export function spread_props ( ...props ) {
244- let destroyed = false
245- teardown ( ( ) => { destroyed = true } )
246- return new Proxy ( { props, oldProps : { } , get destroyed ( ) { return destroyed } } , spread_props_handler ) ;
244+ let destroyed = false ;
245+ teardown ( ( ) => {
246+ destroyed = true ;
247+ } ) ;
248+ return new Proxy (
249+ {
250+ props,
251+ oldProps : { } ,
252+ get destroyed ( ) {
253+ return destroyed ;
254+ }
255+ } ,
256+ spread_props_handler
257+ ) ;
247258}
248259
249260/**
You can’t perform that action at this time.
0 commit comments