async-changeset
Rich Harris 7 months ago
parent 7bf7e0dd78
commit ba957b625f

@ -72,8 +72,6 @@ class Boundary {
active_boundary = this; active_boundary = this;
var parent_boundary = find_boundary(active_effect);
this.#effect = block(() => { this.#effect = block(() => {
/** @type {Effect | null} */ /** @type {Effect | null} */
var main_effect = null; var main_effect = null;
@ -196,7 +194,7 @@ class Boundary {
/** /**
* @param {boolean} initial * @param {boolean} initial
*/ */
function show_pending_snippet(initial) { const show_pending_snippet = (initial) => {
const pending = props.pending; const pending = props.pending;
if (pending !== undefined) { if (pending !== undefined) {
@ -226,12 +224,12 @@ class Boundary {
return true; return true;
}); });
} }
} else if (parent_boundary) { } else if (this.#parent) {
throw new Error('TODO show pending snippet on parent'); throw new Error('TODO show pending snippet on parent');
} else { } else {
throw new Error('no pending snippet to show'); throw new Error('no pending snippet to show');
} }
} };
// @ts-ignore We re-use the effect's fn property to avoid allocation of an additional field // @ts-ignore We re-use the effect's fn property to avoid allocation of an additional field
boundary_effect.fn = (/** @type {unknown} */ input, /** @type {any} */ payload) => { boundary_effect.fn = (/** @type {unknown} */ input, /** @type {any} */ payload) => {
@ -528,17 +526,6 @@ function exit() {
set_component_context(null); set_component_context(null);
} }
/**
* @param {Effect | null} effect
*/
export function find_boundary(effect) {
while (effect !== null && (effect.f & BOUNDARY_EFFECT) === 0) {
effect = effect.parent;
}
return effect;
}
/** /**
* @param {Effect} boundary * @param {Effect} boundary
* @param {Effect} effect * @param {Effect} effect

Loading…
Cancel
Save