@@ -97,23 +97,20 @@ export function proxy(value) {
97
97
e . state_descriptors_fixed ( ) ;
98
98
}
99
99
100
- var s = sources . get ( prop ) ;
101
-
102
- if ( s === undefined ) {
103
- s = with_parent ( ( ) => source ( descriptor . value , stack ) ) ;
104
- sources . set ( prop , s ) ;
100
+ with_parent ( ( ) => {
101
+ var s = sources . get ( prop ) ;
105
102
106
- if ( DEV && typeof prop === 'string' ) {
107
- tag ( s , get_label ( path , prop ) ) ;
108
- }
109
- } else {
110
- var p = with_parent ( ( ) => proxy ( descriptor . value ) ) ;
111
- set ( s , p ) ;
103
+ if ( s === undefined ) {
104
+ s = source ( descriptor . value , stack ) ;
105
+ sources . set ( prop , s ) ;
112
106
113
- if ( DEV ) {
114
- tag_proxy ( p , get_label ( path , prop ) ) ;
107
+ if ( DEV && typeof prop === 'string' ) {
108
+ tag ( s , get_label ( path , prop ) ) ;
109
+ }
110
+ } else {
111
+ set ( s , descriptor . value , true ) ;
115
112
}
116
- }
113
+ } ) ;
117
114
118
115
return true ;
119
116
} ,
@@ -278,22 +275,24 @@ export function proxy(value) {
278
275
// object property before writing to that property.
279
276
if ( s === undefined ) {
280
277
if ( ! has || get_descriptor ( target , prop ) ?. writable ) {
281
- s = with_parent ( ( ) => source ( undefined , stack ) ) ;
282
- var p = with_parent ( ( ) => proxy ( value ) ) ;
278
+ s = with_parent ( ( ) => {
279
+ var s = source ( undefined , stack ) ;
280
+ set ( s , proxy ( value ) ) ;
281
+ return s ;
282
+ } ) ;
283
283
284
284
if ( DEV ) {
285
285
var label = get_label ( path , prop ) ;
286
286
tag ( s , label ) ;
287
- tag_proxy ( p , label ) ;
287
+ tag_proxy ( s . v , label ) ;
288
288
}
289
289
290
- set ( s , p ) ;
291
290
sources . set ( prop , s ) ;
292
291
}
293
292
} else {
294
293
has = s . v !== UNINITIALIZED ;
295
294
296
- p = with_parent ( ( ) => proxy ( value ) ) ;
295
+ var p = with_parent ( ( ) => proxy ( value ) ) ;
297
296
298
297
if ( DEV ) {
299
298
tag_proxy ( p , get_label ( path , prop ) ) ;
0 commit comments