Skip to content

Commit b429eb6

Browse files
committed
use snapshot
1 parent e994a7a commit b429eb6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { effect, teardown } from './reactivity/effects.js';
1515
import { legacy_mode_flag } from '../flags/index.js';
1616
import { CTX_CONTAINS_TEARDOWN, CTX_DESTROYED } from './constants.js';
1717
import { define_property } from '../shared/utils.js';
18+
import { snapshot } from '../shared/clone.js';
1819

1920
/** @type {ComponentContext | null} */
2021
export let component_context = null;
@@ -196,7 +197,7 @@ export function pop(component) {
196197

197198
effect(() => {
198199
if (context_stack_item.f === CTX_CONTAINS_TEARDOWN) {
199-
context_stack_item.tp = { ...context_stack_item.s };
200+
context_stack_item.tp = snapshot(context_stack_item.s, true)
200201
}
201202
});
202203
}

0 commit comments

Comments
 (0)