File tree 1 file changed +11
-2
lines changed
packages/svelte/src/internal/client 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { DEV } from 'esm-env' ;
2
- import { get , batch_inspect , current_component_context , untrack } from './runtime.js' ;
2
+ import {
3
+ get ,
4
+ batch_inspect ,
5
+ current_component_context ,
6
+ untrack ,
7
+ current_effect
8
+ } from './runtime.js' ;
3
9
import {
4
10
array_prototype ,
5
11
define_property ,
@@ -243,7 +249,10 @@ const state_proxy_handler = {
243
249
const has = Reflect . has ( target , prop ) ;
244
250
245
251
let s = metadata . s . get ( prop ) ;
246
- if ( s !== undefined || ! has || get_descriptor ( target , prop ) ?. writable ) {
252
+ if (
253
+ s !== undefined ||
254
+ ( current_effect !== null && ( ! has || get_descriptor ( target , prop ) ?. writable ) )
255
+ ) {
247
256
if ( s === undefined ) {
248
257
s = ( metadata . i ? source : mutable_source ) (
249
258
has ? proxy ( target [ prop ] , metadata . i , metadata . o ) : UNINITIALIZED
You can’t perform that action at this time.
0 commit comments