Skip to content

Commit 978403b

Browse files
committed
fix: @debug must use $state.snapshot() on value
1 parent eb6488c commit 978403b

File tree

1 file changed

+5
-1
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors

1 file changed

+5
-1
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/DebugTag.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import * as b from '../../../../utils/builders.js';
1010
export function DebugTag(node, context) {
1111
const object = b.object(
1212
node.identifiers.map((identifier) =>
13-
b.prop('init', identifier, /** @type {Expression} */ (context.visit(identifier)))
13+
b.prop(
14+
'init',
15+
identifier,
16+
b.call('$.snapshot', /** @type {Expression} */ (context.visit(identifier)))
17+
)
1418
)
1519
);
1620

0 commit comments

Comments
 (0)