diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index 6f07993590..ccf14a9e76 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -74,6 +74,14 @@ function instance($$self, $$props, $$invalidate) { if ('name' in $$props) $$invalidate('name', name = $$props.name); }; + $$self.$capture_state = () => { + return { name }; + }; + + $$self.$inject_state = $$props => { + if ('name' in $$props) $$invalidate('name', name = $$props.name); + }; + return { 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 eea35d5ba7..7adf1a9bf7 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -163,6 +163,17 @@ function instance($$self, $$props, $$invalidate) { if ('baz' in $$props) $$invalidate('baz', baz = $$props.baz); }; + $$self.$capture_state = () => { + return { things, foo, bar, baz }; + }; + + $$self.$inject_state = $$props => { + if ('things' in $$props) $$invalidate('things', things = $$props.things); + if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); + if ('bar' in $$props) $$invalidate('bar', bar = $$props.bar); + if ('baz' in $$props) $$invalidate('baz', baz = $$props.baz); + }; + return { things, foo, bar, baz }; } diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index 5b931d9464..ec48213811 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -161,6 +161,15 @@ function instance($$self, $$props, $$invalidate) { if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); }; + $$self.$capture_state = () => { + return { things, foo }; + }; + + $$self.$inject_state = $$props => { + if ('things' in $$props) $$invalidate('things', things = $$props.things); + if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); + }; + return { things, foo }; } 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 5c4b2ece1b..60f71bf9c4 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -74,6 +74,15 @@ function instance($$self, $$props, $$invalidate) { if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); }; + $$self.$capture_state = () => { + return { foo, bar }; + }; + + $$self.$inject_state = $$props => { + if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); + if ('bar' in $$props) $$invalidate('bar', bar = $$props.bar); + }; + $$self.$$.update = ($$dirty = { foo: 1 }) => { if ($$dirty.foo) { $$invalidate('bar', bar = foo * 2); } };