pull/16091/head
Rich Harris 4 months ago
parent 91458a012d
commit 0a433d92c6

@ -37,22 +37,19 @@ export function handle_error(error) {
/** /**
* @param {unknown} error * @param {unknown} error
* @param {Effect} effect * @param {Effect | null} effect
*/ */
export function invoke_error_boundary(error, effect) { export function invoke_error_boundary(error, effect) {
/** @type {Effect | null} */ while (effect !== null) {
var current = effect; if ((effect.f & BOUNDARY_EFFECT) !== 0) {
while (current !== null) {
if ((current.f & BOUNDARY_EFFECT) !== 0) {
try { try {
// @ts-expect-error // @ts-expect-error
current.fn(error); effect.fn(error);
return; return;
} catch {} } catch {}
} }
current = current.parent; effect = effect.parent;
} }
throw error; throw error;

Loading…
Cancel
Save