From e22a67c432d18fa9647cdfd7b936fce4b7cb39e5 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 12 Oct 2026 20:20:45 -0400 Subject: [PATCH] chore: tidy up comments and types in batch.js and sources.js (#18980) couple of trivial tidy-ups, ref #18880 --- packages/svelte/src/internal/client/reactivity/batch.js | 7 +++---- packages/svelte/src/internal/client/reactivity/sources.js | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/svelte/src/internal/client/reactivity/batch.js b/packages/svelte/src/internal/client/reactivity/batch.js index 3ebeb519d0..f03880444f 100644 --- a/packages/svelte/src/internal/client/reactivity/batch.js +++ b/packages/svelte/src/internal/client/reactivity/batch.js @@ -114,14 +114,14 @@ export class Batch { /** * The current values of any signals that are updated in this batch. * Tuple format: [value, is_derived] (note: is_derived is false for deriveds, too, if they were overridden via assignment) - * They keys of this map are identical to `this.#previous` + * The keys of this map are identical to `this.previous` * @type {Map} */ current = new Map(); /** * The values of any signals (sources and deriveds) that are updated in this batch _before_ those updates took place. - * They keys of this map are identical to `this.#current` + * The keys of this map are identical to `this.current` * @type {Map} */ previous = new Map(); @@ -202,7 +202,6 @@ export class Batch { #decrement_queued = false; constructor() { - // link batch if (last_batch === null) { first_batch = last_batch = this; } else { @@ -1453,7 +1452,7 @@ export function fork(fn) { }, discard: () => { // cause any MAYBE_DIRTY deriveds to update - // if they depend on things thath changed + // if they depend on things that changed // inside the discarded fork for (var source of batch.current.keys()) { source.wv = increment_write_version(); diff --git a/packages/svelte/src/internal/client/reactivity/sources.js b/packages/svelte/src/internal/client/reactivity/sources.js index 4b10ddbd31..14d7b9a2e5 100644 --- a/packages/svelte/src/internal/client/reactivity/sources.js +++ b/packages/svelte/src/internal/client/reactivity/sources.js @@ -70,9 +70,9 @@ export function set_eager_effects_deferred() { */ // TODO rename this to `state` throughout the codebase export function source(v, stack) { - /** @type {Value} */ + /** @type {Source} */ var signal = { - f: 0, // TODO ideally we could skip this altogether, but it causes type errors + f: 0, v, reactions: null, equals,