From 81741197460c41a0be081273dc5390e77377599e Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 8 Sep 2019 20:39:10 -0400 Subject: [PATCH] update tests --- package-lock.json | 2 +- test/js/samples/component-static-var/expected.js | 2 +- test/js/samples/debug-empty/expected.js | 6 +++++- test/js/samples/debug-foo-bar-baz-things/expected.js | 11 +++++++++-- test/js/samples/debug-foo/expected.js | 9 +++++++-- test/js/samples/debug-hoisted/expected.js | 7 ++++++- .../dev-warning-missing-data-computed/expected.js | 9 +++++++-- test/js/samples/event-modifiers/expected.js | 2 +- 8 files changed, 37 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9cc91dbf6f..bd36702370 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "svelte", - "version": "3.10.1", + "version": "3.11.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/test/js/samples/component-static-var/expected.js b/test/js/samples/component-static-var/expected.js index a41178a441..2f6521f87e 100644 --- a/test/js/samples/component-static-var/expected.js +++ b/test/js/samples/component-static-var/expected.js @@ -91,7 +91,7 @@ function create_fragment(ctx) { let y = 1; function instance($$self, $$props, $$invalidate) { - + let z = 2; function input_input_handler() { diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index 02af5bd3a9..851dbaaa4f 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -77,6 +77,10 @@ function instance($$self, $$props, $$invalidate) { if ('name' in $$props) $$invalidate('name', name = $$props.name); }; + $$self.$unsafe_set = $$values => { + if ('name' in $$values) $$invalidate('name', name = $$values.name); + }; + $$self.$capture_state = () => { return { name }; }; @@ -110,4 +114,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file 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 8bd04dd29a..3de09f7bf5 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -50,7 +50,7 @@ function create_each_block(ctx) { p: function update(changed, ctx) { if ((changed.things) && t0_value !== (t0_value = ctx.thing.name + "")) { - set_data(t0, t0_value); + set_data_dev(t0, t0_value); } if (changed.foo || changed.bar || changed.baz || changed.things) { @@ -169,6 +169,13 @@ function instance($$self, $$props, $$invalidate) { if ('baz' in $$props) $$invalidate('baz', baz = $$props.baz); }; + $$self.$unsafe_set = $$values => { + if ('things' in $$values) $$invalidate('things', things = $$values.things); + if ('foo' in $$values) $$invalidate('foo', foo = $$values.foo); + if ('bar' in $$values) $$invalidate('bar', bar = $$values.bar); + if ('baz' in $$values) $$invalidate('baz', baz = $$values.baz); + }; + $$self.$capture_state = () => { return { things, foo, bar, baz }; }; @@ -238,4 +245,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index a6e6764250..7e34482ded 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -50,7 +50,7 @@ function create_each_block(ctx) { p: function update(changed, ctx) { if ((changed.things) && t0_value !== (t0_value = ctx.thing.name + "")) { - set_data(t0, t0_value); + set_data_dev(t0, t0_value); } if (changed.foo) { @@ -167,6 +167,11 @@ function instance($$self, $$props, $$invalidate) { if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); }; + $$self.$unsafe_set = $$values => { + if ('things' in $$values) $$invalidate('things', things = $$values.things); + if ('foo' in $$values) $$invalidate('foo', foo = $$values.foo); + }; + $$self.$capture_state = () => { return { things, foo }; }; @@ -212,4 +217,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/debug-hoisted/expected.js b/test/js/samples/debug-hoisted/expected.js index 47fc0130a0..44a00bc702 100644 --- a/test/js/samples/debug-hoisted/expected.js +++ b/test/js/samples/debug-hoisted/expected.js @@ -46,6 +46,11 @@ let kobzol = 5; function instance($$self) { let obj = { x: 5 }; + $$self.$unsafe_set = $$values => { + if ('obj' in $$values) $$invalidate('obj', obj = $$values.obj); + if ('kobzol' in $$values) $$invalidate('kobzol', kobzol = $$values.kobzol); + }; + $$self.$capture_state = () => { return {} }; @@ -65,4 +70,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file 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 9eb6d72f0f..079e771b64 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -42,7 +42,7 @@ function create_fragment(ctx) { p: function update(changed, ctx) { if ((changed.foo) && t0_value !== (t0_value = Math.max(0, ctx.foo) + "")) { - set_data(t0, t0_value); + set_data_dev(t0, t0_value); } if (changed.bar) { @@ -77,6 +77,11 @@ function instance($$self, $$props, $$invalidate) { if ('foo' in $$props) $$invalidate('foo', foo = $$props.foo); }; + $$self.$unsafe_set = $$values => { + if ('foo' in $$values) $$invalidate('foo', foo = $$values.foo); + if ('bar' in $$values) $$invalidate('bar', bar = $$values.bar); + }; + $$self.$capture_state = () => { return { foo, bar }; }; @@ -115,4 +120,4 @@ class Component extends SvelteComponentDev { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/event-modifiers/expected.js b/test/js/samples/event-modifiers/expected.js index 5048cc5955..bd449ea5a4 100644 --- a/test/js/samples/event-modifiers/expected.js +++ b/test/js/samples/event-modifiers/expected.js @@ -75,4 +75,4 @@ class Component extends SvelteComponent { } } -export default Component; +export default Component; \ No newline at end of file