Skip to content

Commit bf5b721

Browse files
committed
WIP
1 parent 9d01d36 commit bf5b721

File tree

2 files changed

+9
-3
lines changed
  • packages/svelte
    • src/compiler/phases/3-transform/client/visitors/shared
    • tests/snapshot/samples/purity/_expected/client

2 files changed

+9
-3
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,11 @@ export function build_expression(context, expression, metadata, state = context.
387387

388388
var getter = build_getter({ ...binding.node }, state);
389389

390-
if (binding.kind === 'bindable_prop') {
390+
if (
391+
binding.kind === 'bindable_prop' ||
392+
binding.node.name === '$$props' ||
393+
binding.node.name === '$$restProps'
394+
) {
391395
getter = b.call('$.deep_read_state', getter);
392396
}
393397

packages/svelte/tests/snapshot/samples/purity/_expected/client/index.svelte.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ export default function Purity($$anchor) {
88
var fragment = root();
99
var p = $.first_child(fragment);
1010

11-
p.textContent = '0';
11+
p.textContent = (
12+
$.untrack(() => Math.max(0, Math.min(0, 100)))
13+
);
1214

1315
var p_1 = $.sibling(p, 2);
1416

15-
p_1.textContent = location.href;
17+
p_1.textContent = ($.untrack(() => location.href));
1618

1719
var node = $.sibling(p_1, 2);
1820

0 commit comments

Comments
 (0)