Skip to content

Commit 02efac9

Browse files
committed
fix
1 parent 90cdc16 commit 02efac9

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

packages/svelte/src/internal/client/runtime.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -258,19 +258,21 @@ export function check_dirtiness(reaction) {
258258
* @param {Effect} effect
259259
*/
260260
function propagate_error(error, effect) {
261-
var boundary = effect.b;
261+
/** @type {Effect | null} */
262+
var current = effect;
262263

263-
while (boundary !== null) {
264-
if (!boundary.inert) {
264+
while (current !== null) {
265+
if ((current.f & BOUNDARY_EFFECT) !== 0) {
265266
try {
266-
boundary.error(error);
267+
/** @type {Boundary} */ (current.b).error(error);
267268
return;
268269
} catch {
269-
boundary.inert = true;
270+
// Remove boundary flag from effect
271+
current.f ^= BOUNDARY_EFFECT;
270272
}
271273
}
272274

273-
boundary = boundary.parent;
275+
current = current.parent;
274276
}
275277

276278
is_throwing_error = false;
@@ -281,7 +283,10 @@ function propagate_error(error, effect) {
281283
* @param {Effect} effect
282284
*/
283285
function should_rethrow_error(effect) {
284-
return (effect.f & DESTROYED) === 0 && (effect.parent === null || !effect.b || effect.b.inert);
286+
return (
287+
(effect.f & DESTROYED) === 0 &&
288+
(effect.parent === null || (effect.parent.f & BOUNDARY_EFFECT) === 0)
289+
);
285290
}
286291

287292
export function reset_is_throwing_error() {

0 commit comments

Comments
 (0)