From f991d9d4377c9d01b36871b4e94e22ac9626219a Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 5 Jul 2025 16:20:45 -0400 Subject: [PATCH] remove TODO - this method is only called when pending snippet exists --- .../internal/client/dom/blocks/boundary.js | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/packages/svelte/src/internal/client/dom/blocks/boundary.js b/packages/svelte/src/internal/client/dom/blocks/boundary.js index 1b3ace58e5..69a5bd45ad 100644 --- a/packages/svelte/src/internal/client/dom/blocks/boundary.js +++ b/packages/svelte/src/internal/client/dom/blocks/boundary.js @@ -196,22 +196,15 @@ export class Boundary { } #show_pending_snippet() { - const pending = this.#props.pending; + const pending = /** @type {(anchor: Node) => void} */ (this.#props.pending); - if (pending !== undefined) { - // TODO can this be false? - if (this.#main_effect !== null) { - this.#offscreen_fragment = document.createDocumentFragment(); - move_effect(this.#main_effect, this.#offscreen_fragment); - } + if (this.#main_effect !== null) { + this.#offscreen_fragment = document.createDocumentFragment(); + move_effect(this.#main_effect, this.#offscreen_fragment); + } - if (this.#pending_effect === null) { - this.#pending_effect = branch(() => pending(this.#anchor)); - } - } else if (this.parent) { - throw new Error('TODO show pending snippet on parent'); - } else { - throw new Error('no pending snippet to show'); + if (this.#pending_effect === null) { + this.#pending_effect = branch(() => pending(this.#anchor)); } }