@@ -208,52 +208,44 @@ export function batch_inspect(target, prop, receiver) {
208
208
export function check_dirtiness ( reaction ) {
209
209
var flags = reaction . f ;
210
210
var is_dirty = ( flags & DIRTY ) !== 0 ;
211
- var is_unowned = ( flags & UNOWNED ) !== 0 ;
212
211
213
- // If we are unowned, we still need to ensure that we update our version to that
214
- // of our dependencies.
215
- if ( is_dirty && ! is_unowned ) {
212
+ if ( is_dirty ) {
216
213
return true ;
217
214
}
218
215
216
+ var is_unowned = ( flags & UNOWNED ) !== 0 ;
219
217
var is_disconnected = ( flags & DISCONNECTED ) !== 0 ;
220
218
221
- if ( ( flags & MAYBE_DIRTY ) !== 0 || ( is_dirty && is_unowned ) ) {
219
+ if ( ( flags & MAYBE_DIRTY ) !== 0 ) {
222
220
var dependencies = reaction . deps ;
223
221
224
222
if ( dependencies !== null ) {
225
223
var length = dependencies . length ;
226
- var is_equal ;
227
224
var reactions ;
228
225
229
226
for ( var i = 0 ; i < length ; i ++ ) {
230
227
var dependency = dependencies [ i ] ;
231
228
232
229
if ( ! is_dirty && check_dirtiness ( /** @type {import('#client').Derived } */ ( dependency ) ) ) {
233
- is_equal = update_derived ( /** @type {import('#client').Derived } **/ ( dependency ) , true ) ;
230
+ update_derived ( /** @type {import('#client').Derived } **/ ( dependency ) , true ) ;
234
231
}
232
+
235
233
var version = dependency . version ;
236
234
237
235
if ( is_unowned ) {
238
236
// If we're working with an unowned derived signal, then we need to check
239
237
// if our dependency write version is higher. If it is then we can assume
240
238
// that state has changed to a newer version and thus this unowned signal
241
239
// is also dirty.
242
-
243
240
if ( version > /** @type {import('#client').Derived } */ ( reaction ) . version ) {
244
- return ! is_equal ;
241
+ return true ;
245
242
}
246
243
247
244
if ( ! current_skip_reaction && ! dependency ?. reactions ?. includes ( reaction ) ) {
248
245
// If we are working with an unowned signal as part of an effect (due to !current_skip_reaction)
249
246
// and the version hasn't changed, we still need to check that this reaction
250
247
// if linked to the dependency source – otherwise future updates will not be caught.
251
- reactions = dependency . reactions ;
252
- if ( reactions === null ) {
253
- dependency . reactions = [ reaction ] ;
254
- } else {
255
- reactions . push ( reaction ) ;
256
- }
248
+ ( dependency . reactions ??= [ ] ) . push ( reaction ) ;
257
249
}
258
250
} else if ( ( reaction . f & DIRTY ) !== 0 ) {
259
251
// `signal` might now be dirty, as a result of calling `check_dirtiness` and/or `update_derived`
0 commit comments