diff --git a/packages/svelte/src/internal/client/dom/blocks/boundary.js b/packages/svelte/src/internal/client/dom/blocks/boundary.js index 2387b22f51..20839a7783 100644 --- a/packages/svelte/src/internal/client/dom/blocks/boundary.js +++ b/packages/svelte/src/internal/client/dom/blocks/boundary.js @@ -2,7 +2,7 @@ import { BOUNDARY_EFFECT, EFFECT_TRANSPARENT } from '#client/constants'; import { component_context, set_component_context } from '../../context.js'; -import { invoke_error_boundary, reset_is_throwing_error } from '../../error-handling.js'; +import { invoke_error_boundary } from '../../error-handling.js'; import { block, branch, destroy_effect, pause_effect } from '../../reactivity/effects.js'; import { active_effect, @@ -80,7 +80,6 @@ export function boundary(node, props, boundary_fn) { with_boundary(boundary, () => { is_creating_fallback = false; boundary_effect = branch(() => boundary_fn(anchor)); - reset_is_throwing_error(); }); }; @@ -119,7 +118,6 @@ export function boundary(node, props, boundary_fn) { invoke_error_boundary(error, /** @type {Effect} */ (boundary.parent)); } - reset_is_throwing_error(); is_creating_fallback = false; }); }); @@ -131,7 +129,6 @@ export function boundary(node, props, boundary_fn) { } boundary_effect = branch(() => boundary_fn(anchor)); - reset_is_throwing_error(); }, EFFECT_TRANSPARENT | BOUNDARY_EFFECT); if (hydrating) { diff --git a/packages/svelte/src/internal/client/error-handling.js b/packages/svelte/src/internal/client/error-handling.js index 2e5c31b7a1..c27ba1a360 100644 --- a/packages/svelte/src/internal/client/error-handling.js +++ b/packages/svelte/src/internal/client/error-handling.js @@ -2,19 +2,13 @@ import { DEV } from 'esm-env'; import { FILENAME } from '../../constants.js'; import { is_firefox } from './dom/operations.js'; -import { BOUNDARY_EFFECT, DESTROYED } from './constants.js'; +import { BOUNDARY_EFFECT } from './constants.js'; import { define_property } from '../shared/utils.js'; // Used for DEV time error handling /** @param {WeakSet} value */ const adjusted_errors = new WeakSet(); -let is_throwing_error = false; - -export function reset_is_throwing_error() { - is_throwing_error = false; -} - /** @type {null | unknown} */ let current_error = null; @@ -58,20 +52,9 @@ export function invoke_error_boundary(error, effect) { current = current.parent; } - is_throwing_error = false; throw error; } -/** - * @param {Effect} effect - */ -function should_rethrow_error(effect) { - return ( - (effect.f & DESTROYED) === 0 && - (effect.parent === null || (effect.parent.f & BOUNDARY_EFFECT) === 0) - ); -} - /** * Add useful information to the error message/stack * @param {Error} error