Skip to content

Commit 2019451

Browse files
committed
is_dirty is a better name than check_dirtiness
1 parent 179980e commit 2019451

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

packages/svelte/src/internal/client/reactivity/batch.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { deferred, define_property } from '../../shared/utils.js';
1616
import { get_pending_boundary } from '../dom/blocks/boundary.js';
1717
import {
1818
active_effect,
19-
check_dirtiness,
19+
is_dirty,
2020
is_updating_effect,
2121
set_is_updating_effect,
2222
set_signal_status,
@@ -273,7 +273,7 @@ export class Batch {
273273
this.#effects.push(effect);
274274
} else if (async_mode_flag && (flags & RENDER_EFFECT) !== 0) {
275275
this.#render_effects.push(effect);
276-
} else if (check_dirtiness(effect)) {
276+
} else if (is_dirty(effect)) {
277277
if ((flags & EFFECT_ASYNC) !== 0) {
278278
var effects = effect.b?.pending ? this.#boundary_async_effects : this.#async_effects;
279279
effects.push(effect);
@@ -530,7 +530,7 @@ function flush_queued_effects(effects) {
530530
var effect = effects[i];
531531

532532
if ((effect.f & (DESTROYED | INERT)) === 0) {
533-
if (check_dirtiness(effect)) {
533+
if (is_dirty(effect)) {
534534
var wv = write_version;
535535

536536
update_effect(effect);

packages/svelte/src/internal/client/reactivity/effects.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @import { ComponentContext, ComponentContextLegacy, Derived, Effect, TemplateNode, TransitionManager } from '#client' */
22
import {
3-
check_dirtiness,
3+
is_dirty,
44
active_effect,
55
active_reaction,
66
update_effect,
@@ -323,7 +323,7 @@ export function legacy_pre_effect_reset() {
323323
set_signal_status(effect, MAYBE_DIRTY);
324324
}
325325

326-
if (check_dirtiness(effect)) {
326+
if (is_dirty(effect)) {
327327
update_effect(effect);
328328
}
329329

@@ -614,7 +614,7 @@ function resume_children(effect, local) {
614614
effect.f ^= INERT;
615615

616616
// If a dependency of this effect changed while it was paused,
617-
// schedule the effect to update. we don't use `check_dirtiness`
617+
// schedule the effect to update. we don't use `is_dirty`
618618
// here because we don't want to eagerly recompute a derived like
619619
// `{#if foo}{foo.bar()}{/if}` if `foo` is now `undefined
620620
if ((effect.f & CLEAN) === 0) {

packages/svelte/src/internal/client/reactivity/sources.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
increment_write_version,
1212
update_effect,
1313
source_ownership,
14-
check_dirtiness,
14+
is_dirty,
1515
untracking,
1616
is_destroying_effect,
1717
push_reaction_value
@@ -222,7 +222,8 @@ export function internal_set(source, value) {
222222
if ((effect.f & CLEAN) !== 0) {
223223
set_signal_status(effect, MAYBE_DIRTY);
224224
}
225-
if (check_dirtiness(effect)) {
225+
226+
if (is_dirty(effect)) {
226227
update_effect(effect);
227228
}
228229
}

packages/svelte/src/internal/client/runtime.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export function increment_write_version() {
155155
* @param {Reaction} reaction
156156
* @returns {boolean}
157157
*/
158-
export function check_dirtiness(reaction) {
158+
export function is_dirty(reaction) {
159159
var flags = reaction.f;
160160

161161
if ((flags & DIRTY) !== 0) {
@@ -208,7 +208,7 @@ export function check_dirtiness(reaction) {
208208
for (i = 0; i < length; i++) {
209209
dependency = dependencies[i];
210210

211-
if (check_dirtiness(/** @type {Derived} */ (dependency))) {
211+
if (is_dirty(/** @type {Derived} */ (dependency))) {
212212
update_derived(/** @type {Derived} */ (dependency));
213213
}
214214

@@ -607,7 +607,7 @@ export function get(signal) {
607607
if (is_derived && !is_destroying_effect && batch_deriveds === null) {
608608
derived = /** @type {Derived} */ (signal);
609609

610-
if (check_dirtiness(derived)) {
610+
if (is_dirty(derived)) {
611611
update_derived(derived);
612612
}
613613
}

0 commit comments

Comments
 (0)