diff --git a/src/compiler/compile/render_dom/index.ts b/src/compiler/compile/render_dom/index.ts index 8bcf2179e0..db95dedf61 100644 --- a/src/compiler/compile/render_dom/index.ts +++ b/src/compiler/compile/render_dom/index.ts @@ -181,9 +181,9 @@ export default function dom( const var_names = (variables: Var[]) => variables.map(prop => p`${prop.name}`); capture_state = x` - ({ props: $props = true, local: $local = true } = {}) => ({ - ...${x`$props && { ${var_names(capturable_props)} }`}, - ...${x`$local && { ${var_names(local_vars)} }`} + ({ props: $p = true, local: $l = true } = {}) => ({ + ...${x`$p && { ${var_names(capturable_props)} }`}, + ...${x`$l && { ${var_names(local_vars)} }`} }) `; diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index e647ff8842..6bb73f7913 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -79,10 +79,7 @@ function instance($$self, $$props, $$invalidate) { if ("name" in $$props) $$invalidate(0, name = $$props.name); }; - $$self.$capture_state = ({ props: $props = true, local: $local = true } = {}) => ({ - ...$props && ({ name }), - ...$local && ({}) - }); + $$self.$capture_state = ({ props: $p = true, local: $l = true } = {}) => ({ ...$p && ({ name }), ...$l && ({}) }); $$self.$inject_state = $$props => { if ("name" in $$props) $$invalidate(0, name = $$props.name); diff --git a/test/js/samples/debug-foo-bar-baz-things/expected.js b/test/js/samples/debug-foo-bar-baz-things/expected.js index 013e588aaa..ce802a35a5 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -183,9 +183,9 @@ function instance($$self, $$props, $$invalidate) { if ("baz" in $$props) $$invalidate(3, baz = $$props.baz); }; - $$self.$capture_state = ({ props: $props = true, local: $local = true } = {}) => ({ - ...$props && ({ things, foo, bar, baz }), - ...$local && ({}) + $$self.$capture_state = ({ props: $p = true, local: $l = true } = {}) => ({ + ...$p && ({ things, foo, bar, baz }), + ...$l && ({}) }); $$self.$inject_state = $$props => { diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index c8963240e9..a23a5d1617 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -173,9 +173,9 @@ function instance($$self, $$props, $$invalidate) { if ("foo" in $$props) $$invalidate(1, foo = $$props.foo); }; - $$self.$capture_state = ({ props: $props = true, local: $local = true } = {}) => ({ - ...$props && ({ things, foo }), - ...$local && ({}) + $$self.$capture_state = ({ props: $p = true, local: $l = true } = {}) => ({ + ...$p && ({ things, foo }), + ...$l && ({}) }); $$self.$inject_state = $$props => { diff --git a/test/js/samples/debug-hoisted/expected.js b/test/js/samples/debug-hoisted/expected.js index 6907ce393e..64fefab07b 100644 --- a/test/js/samples/debug-hoisted/expected.js +++ b/test/js/samples/debug-hoisted/expected.js @@ -51,9 +51,9 @@ function instance($$self) { let obj = { x: 5 }; let kobzol = 5; - $$self.$capture_state = ({ props: $props = true, local: $local = true } = {}) => ({ - ...$props && ({}), - ...$local && ({ obj, kobzol }) + $$self.$capture_state = ({ props: $p = true, local: $l = true } = {}) => ({ + ...$p && ({}), + ...$l && ({ obj, kobzol }) }); $$self.$inject_state = $$props => { diff --git a/test/js/samples/dev-warning-missing-data-computed/expected.js b/test/js/samples/dev-warning-missing-data-computed/expected.js index 0838090408..ea69e3b787 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -76,10 +76,7 @@ function instance($$self, $$props, $$invalidate) { if ("foo" in $$props) $$invalidate(0, foo = $$props.foo); }; - $$self.$capture_state = ({ props: $props = true, local: $local = true } = {}) => ({ - ...$props && ({ foo }), - ...$local && ({ bar }) - }); + $$self.$capture_state = ({ props: $p = true, local: $l = true } = {}) => ({ ...$p && ({ foo }), ...$l && ({ bar }) }); $$self.$inject_state = $$props => { if ("foo" in $$props) $$invalidate(0, foo = $$props.foo);