diff --git a/test/js/samples/action-custom-event-handler/expected.js b/test/js/samples/action-custom-event-handler/expected.js index da42603895..da5d566e2c 100644 --- a/test/js/samples/action-custom-event-handler/expected.js +++ b/test/js/samples/action-custom-event-handler/expected.js @@ -42,7 +42,7 @@ function handleFoo(bar) { } function foo(node, callback) { - + } function instance($$self, $$props, $$invalidate) { @@ -50,7 +50,7 @@ function instance($$self, $$props, $$invalidate) { const foo_function = () => handleFoo(bar); $$self.$set = $$props => { - if ("bar" in $$props) $$invalidate(0, bar = $$props.bar); + if ("bar" in $$props) $$invalidate({ i: 0, ret: bar = $$props.bar }); }; return [bar, foo_function]; diff --git a/test/js/samples/bind-online/expected.js b/test/js/samples/bind-online/expected.js index 8285646481..f70b40d872 100644 --- a/test/js/samples/bind-online/expected.js +++ b/test/js/samples/bind-online/expected.js @@ -34,7 +34,7 @@ function instance($$self, $$props, $$invalidate) { let online; function onlinestatuschanged() { - $$invalidate(0, online = navigator.onLine); + $$invalidate({ i: 0, ret: online = navigator.onLine }); } return [online, onlinestatuschanged]; diff --git a/test/js/samples/bind-open/expected.js b/test/js/samples/bind-open/expected.js index d4f148cac9..586e6227df 100644 --- a/test/js/samples/bind-open/expected.js +++ b/test/js/samples/bind-open/expected.js @@ -46,11 +46,11 @@ function instance($$self, $$props, $$invalidate) { function details_toggle_handler() { open = this.open; - $$invalidate(0, open); + $$invalidate({ i: 0, ret: open }); } $$self.$set = $$props => { - if ("open" in $$props) $$invalidate(0, open = $$props.open); + if ("open" in $$props) $$invalidate({ i: 0, ret: open = $$props.open }); }; return [open, details_toggle_handler]; diff --git a/test/js/samples/bind-width-height/expected.js b/test/js/samples/bind-width-height/expected.js index 5c1888b7db..de1928b444 100644 --- a/test/js/samples/bind-width-height/expected.js +++ b/test/js/samples/bind-width-height/expected.js @@ -42,13 +42,13 @@ function instance($$self, $$props, $$invalidate) { function div_elementresize_handler() { w = this.offsetWidth; h = this.offsetHeight; - $$invalidate(0, w); - $$invalidate(1, h); + $$invalidate({ i: 0, ret: w }); + $$invalidate({ i: 1, ret: h }); } $$self.$set = $$props => { - if ("w" in $$props) $$invalidate(0, w = $$props.w); - if ("h" in $$props) $$invalidate(1, h = $$props.h); + if ("w" in $$props) $$invalidate({ i: 0, ret: w = $$props.w }); + if ("h" in $$props) $$invalidate({ i: 1, ret: h = $$props.h }); }; return [w, h, div_elementresize_handler]; diff --git a/test/js/samples/bindings-readonly-order/expected.js b/test/js/samples/bindings-readonly-order/expected.js index cf30686662..204ca211ab 100644 --- a/test/js/samples/bindings-readonly-order/expected.js +++ b/test/js/samples/bindings-readonly-order/expected.js @@ -54,16 +54,16 @@ function instance($$self, $$props, $$invalidate) { function input0_change_handler() { files = this.files; - $$invalidate(0, files); + $$invalidate({ i: 0, ret: files }); } function input1_change_handler() { files = this.files; - $$invalidate(0, files); + $$invalidate({ i: 0, ret: files }); } $$self.$set = $$props => { - if ("files" in $$props) $$invalidate(0, files = $$props.files); + if ("files" in $$props) $$invalidate({ i: 0, ret: files = $$props.files }); }; return [files, input0_change_handler, input1_change_handler]; diff --git a/test/js/samples/capture-inject-dev-only/expected.js b/test/js/samples/capture-inject-dev-only/expected.js index 6c639d9207..e57eec3e39 100644 --- a/test/js/samples/capture-inject-dev-only/expected.js +++ b/test/js/samples/capture-inject-dev-only/expected.js @@ -60,7 +60,7 @@ function instance($$self, $$props, $$invalidate) { function input_input_handler() { foo = this.value; - $$invalidate(0, foo); + $$invalidate({ i: 0, ret: foo }); } return [foo, input_input_handler]; diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index 8c0e9d5373..6e813b8678 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -49,7 +49,7 @@ function instance($$self, $$props, $$invalidate) { let { foo = 42 } = $$props; $$self.$set = $$props => { - if ("foo" in $$props) $$invalidate(0, foo = $$props.foo); + if ("foo" in $$props) $$invalidate({ i: 0, ret: foo = $$props.foo }); }; return [foo]; @@ -63,4 +63,4 @@ class Component extends SvelteComponent { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/component-static-var/expected.js b/test/js/samples/component-static-var/expected.js index e01402b6d4..19fb4f98f2 100644 --- a/test/js/samples/component-static-var/expected.js +++ b/test/js/samples/component-static-var/expected.js @@ -84,7 +84,7 @@ function instance($$self, $$props, $$invalidate) { function input_input_handler() { z = this.value; - $$invalidate(0, z); + $$invalidate({ i: 0, ret: z }); } return [z, input_input_handler]; diff --git a/test/js/samples/component-store-access-invalidate/expected.js b/test/js/samples/component-store-access-invalidate/expected.js index 4c7bfd7009..2670ecd52d 100644 --- a/test/js/samples/component-store-access-invalidate/expected.js +++ b/test/js/samples/component-store-access-invalidate/expected.js @@ -42,7 +42,7 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let $foo; const foo = writable(0); - component_subscribe($$self, foo, value => $$invalidate(0, $foo = value)); + component_subscribe($$self, foo, value => $$invalidate({ i: 0, ret: $foo = value })); return [$foo, foo]; } diff --git a/test/js/samples/component-store-file-invalidate/expected.js b/test/js/samples/component-store-file-invalidate/expected.js index d2fb3d0be4..33387c09f7 100644 --- a/test/js/samples/component-store-file-invalidate/expected.js +++ b/test/js/samples/component-store-file-invalidate/expected.js @@ -11,7 +11,7 @@ import { count } from "./store.js"; function instance($$self, $$props, $$invalidate) { let $count; - component_subscribe($$self, count, $$value => $$invalidate(1, $count = $$value)); + component_subscribe($$self, count, $$value => $$invalidate({ i: 1, ret: $count = $$value })); function increment() { set_store_value(count, $count++, $count); diff --git a/test/js/samples/component-store-reassign-invalidate/expected.js b/test/js/samples/component-store-reassign-invalidate/expected.js index 02a74cf22e..ca729c9343 100644 --- a/test/js/samples/component-store-reassign-invalidate/expected.js +++ b/test/js/samples/component-store-reassign-invalidate/expected.js @@ -56,12 +56,12 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let $foo, $$unsubscribe_foo = noop, - $$subscribe_foo = () => ($$unsubscribe_foo(), $$unsubscribe_foo = subscribe(foo, $$value => $$invalidate(1, $foo = $$value)), foo); + $$subscribe_foo = () => ($$unsubscribe_foo(), $$unsubscribe_foo = subscribe(foo, $$value => $$invalidate({ i: 1, ret: $foo = $$value })), foo); $$self.$$.on_destroy.push(() => $$unsubscribe_foo()); let foo = writable(0); $$subscribe_foo(); - const click_handler = () => $$subscribe_foo($$invalidate(0, foo = writable(0))); + const click_handler = () => $$subscribe_foo($$invalidate({ i: 0, ret: foo = writable(0) })); return [foo, $foo, click_handler]; } diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js index 8e5964f8a6..4d57594701 100644 --- a/test/js/samples/computed-collapsed-if/expected.js +++ b/test/js/samples/computed-collapsed-if/expected.js @@ -13,7 +13,7 @@ function instance($$self, $$props, $$invalidate) { } $$self.$set = $$props => { - if ("x" in $$props) $$invalidate(0, x = $$props.x); + if ("x" in $$props) $$invalidate({ i: 0, ret: x = $$props.x }); }; return [x, a, b]; diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index 0566c22ddd..f477670059 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -46,4 +46,4 @@ class Component extends SvelteComponent { } } -export default Component; +export default Component; \ No newline at end of file diff --git a/test/js/samples/data-attribute/expected.js b/test/js/samples/data-attribute/expected.js index 49ad2f2626..652316e13c 100644 --- a/test/js/samples/data-attribute/expected.js +++ b/test/js/samples/data-attribute/expected.js @@ -48,7 +48,7 @@ function instance($$self, $$props, $$invalidate) { let { bar } = $$props; $$self.$set = $$props => { - if ("bar" in $$props) $$invalidate(0, bar = $$props.bar); + if ("bar" in $$props) $$invalidate({ i: 0, ret: bar = $$props.bar }); }; return [bar]; diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index 5821faadf1..ae05c3676e 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -76,7 +76,7 @@ function instance($$self, $$props, $$invalidate) { }); $$self.$set = $$props => { - if ("name" in $$props) $$invalidate(0, name = $$props.name); + if ("name" in $$props) $$invalidate({ i: 0, ret: name = $$props.name }); }; $$self.$capture_state = () => { @@ -84,7 +84,7 @@ function instance($$self, $$props, $$invalidate) { }; $$self.$inject_state = $$props => { - if ("name" in $$props) $$invalidate(0, name = $$props.name); + if ("name" in $$props) $$invalidate({ i: 0, ret: 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 a1d6dba3b3..3cc81de7b8 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -177,10 +177,10 @@ function instance($$self, $$props, $$invalidate) { }); $$self.$set = $$props => { - if ("things" in $$props) $$invalidate(0, things = $$props.things); - if ("foo" in $$props) $$invalidate(1, foo = $$props.foo); - if ("bar" in $$props) $$invalidate(2, bar = $$props.bar); - if ("baz" in $$props) $$invalidate(3, baz = $$props.baz); + if ("things" in $$props) $$invalidate({ i: 0, ret: things = $$props.things }); + if ("foo" in $$props) $$invalidate({ i: 1, ret: foo = $$props.foo }); + if ("bar" in $$props) $$invalidate({ i: 2, ret: bar = $$props.bar }); + if ("baz" in $$props) $$invalidate({ i: 3, ret: baz = $$props.baz }); }; $$self.$capture_state = () => { @@ -188,10 +188,10 @@ function instance($$self, $$props, $$invalidate) { }; $$self.$inject_state = $$props => { - if ("things" in $$props) $$invalidate(0, things = $$props.things); - if ("foo" in $$props) $$invalidate(1, foo = $$props.foo); - if ("bar" in $$props) $$invalidate(2, bar = $$props.bar); - if ("baz" in $$props) $$invalidate(3, baz = $$props.baz); + if ("things" in $$props) $$invalidate({ i: 0, ret: things = $$props.things }); + if ("foo" in $$props) $$invalidate({ i: 1, ret: foo = $$props.foo }); + if ("bar" in $$props) $$invalidate({ i: 2, ret: bar = $$props.bar }); + if ("baz" in $$props) $$invalidate({ i: 3, ret: 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 af79667cc2..8899870c4e 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -169,8 +169,8 @@ function instance($$self, $$props, $$invalidate) { }); $$self.$set = $$props => { - if ("things" in $$props) $$invalidate(0, things = $$props.things); - if ("foo" in $$props) $$invalidate(1, foo = $$props.foo); + if ("things" in $$props) $$invalidate({ i: 0, ret: things = $$props.things }); + if ("foo" in $$props) $$invalidate({ i: 1, ret: foo = $$props.foo }); }; $$self.$capture_state = () => { @@ -178,8 +178,8 @@ function instance($$self, $$props, $$invalidate) { }; $$self.$inject_state = $$props => { - if ("things" in $$props) $$invalidate(0, things = $$props.things); - if ("foo" in $$props) $$invalidate(1, foo = $$props.foo); + if ("things" in $$props) $$invalidate({ i: 0, ret: things = $$props.things }); + if ("foo" in $$props) $$invalidate({ i: 1, ret: foo = $$props.foo }); }; return [things, foo]; diff --git a/test/js/samples/debug-hoisted/expected.js b/test/js/samples/debug-hoisted/expected.js index eeb9465499..0b3f7199dc 100644 --- a/test/js/samples/debug-hoisted/expected.js +++ b/test/js/samples/debug-hoisted/expected.js @@ -56,8 +56,8 @@ function instance($$self) { }; $$self.$inject_state = $$props => { - if ("obj" in $$props) $$invalidate(0, obj = $$props.obj); - if ("kobzol" in $$props) $$invalidate(1, kobzol = $$props.kobzol); + if ("obj" in $$props) $$invalidate({ i: 0, ret: obj = $$props.obj }); + if ("kobzol" in $$props) $$invalidate({ i: 1, ret: kobzol = $$props.kobzol }); }; return [obj, kobzol]; diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js index fb98844ef7..e750b85f6f 100644 --- a/test/js/samples/deconflict-builtins/expected.js +++ b/test/js/samples/deconflict-builtins/expected.js @@ -105,7 +105,10 @@ function instance($$self, $$props, $$invalidate) { let { createElement } = $$props; $$self.$set = $$props => { - if ("createElement" in $$props) $$invalidate(0, createElement = $$props.createElement); + if ("createElement" in $$props) $$invalidate({ + i: 0, + ret: createElement = $$props.createElement + }); }; return [createElement]; diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js index 7e83c21f0e..bbf3107025 100644 --- a/test/js/samples/deconflict-globals/expected.js +++ b/test/js/samples/deconflict-globals/expected.js @@ -11,7 +11,7 @@ function instance($$self, $$props, $$invalidate) { }); $$self.$set = $$props => { - if ("foo" in $$props) $$invalidate(0, foo = $$props.foo); + if ("foo" in $$props) $$invalidate({ i: 0, ret: foo = $$props.foo }); }; return [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 beb794a50c..4858946da1 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -73,7 +73,7 @@ function instance($$self, $$props, $$invalidate) { }); $$self.$set = $$props => { - if ("foo" in $$props) $$invalidate(0, foo = $$props.foo); + if ("foo" in $$props) $$invalidate({ i: 0, ret: foo = $$props.foo }); }; $$self.$capture_state = () => { @@ -81,13 +81,13 @@ function instance($$self, $$props, $$invalidate) { }; $$self.$inject_state = $$props => { - if ("foo" in $$props) $$invalidate(0, foo = $$props.foo); - if ("bar" in $$props) $$invalidate(1, bar = $$props.bar); + if ("foo" in $$props) $$invalidate({ i: 0, ret: foo = $$props.foo }); + if ("bar" in $$props) $$invalidate({ i: 1, ret: bar = $$props.bar }); }; $$self.$$.update = () => { if ($$self.$$.dirty & /*foo*/ 1) { - $: $$invalidate(1, bar = foo * 2); + $: $$invalidate({ i: 1, ret: bar = foo * 2 }); } }; diff --git a/test/js/samples/each-block-array-literal/expected.js b/test/js/samples/each-block-array-literal/expected.js index 10d835cf78..a7e2e01d56 100644 --- a/test/js/samples/each-block-array-literal/expected.js +++ b/test/js/samples/each-block-array-literal/expected.js @@ -107,11 +107,11 @@ function instance($$self, $$props, $$invalidate) { let { e } = $$props; $$self.$set = $$props => { - if ("a" in $$props) $$invalidate(0, a = $$props.a); - if ("b" in $$props) $$invalidate(1, b = $$props.b); - if ("c" in $$props) $$invalidate(2, c = $$props.c); - if ("d" in $$props) $$invalidate(3, d = $$props.d); - if ("e" in $$props) $$invalidate(4, e = $$props.e); + if ("a" in $$props) $$invalidate({ i: 0, ret: a = $$props.a }); + if ("b" in $$props) $$invalidate({ i: 1, ret: b = $$props.b }); + if ("c" in $$props) $$invalidate({ i: 2, ret: c = $$props.c }); + if ("d" in $$props) $$invalidate({ i: 3, ret: d = $$props.d }); + if ("e" in $$props) $$invalidate({ i: 4, ret: e = $$props.e }); }; return [a, b, c, d, e]; diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index 5d88032b87..aeedc72f06 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -153,10 +153,10 @@ function instance($$self, $$props, $$invalidate) { let { foo } = $$props; $$self.$set = $$props => { - if ("comments" in $$props) $$invalidate(0, comments = $$props.comments); - if ("elapsed" in $$props) $$invalidate(1, elapsed = $$props.elapsed); - if ("time" in $$props) $$invalidate(2, time = $$props.time); - if ("foo" in $$props) $$invalidate(3, foo = $$props.foo); + if ("comments" in $$props) $$invalidate({ i: 0, ret: comments = $$props.comments }); + if ("elapsed" in $$props) $$invalidate({ i: 1, ret: elapsed = $$props.elapsed }); + if ("time" in $$props) $$invalidate({ i: 2, ret: time = $$props.time }); + if ("foo" in $$props) $$invalidate({ i: 3, ret: foo = $$props.foo }); }; return [comments, elapsed, time, foo]; diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js index 3b697d6860..451d519911 100644 --- a/test/js/samples/each-block-keyed-animated/expected.js +++ b/test/js/samples/each-block-keyed-animated/expected.js @@ -127,7 +127,7 @@ function instance($$self, $$props, $$invalidate) { let { things } = $$props; $$self.$set = $$props => { - if ("things" in $$props) $$invalidate(0, things = $$props.things); + if ("things" in $$props) $$invalidate({ i: 0, ret: things = $$props.things }); }; return [things]; diff --git a/test/js/samples/each-block-keyed/expected.js b/test/js/samples/each-block-keyed/expected.js index 1cd9a31ece..38d809f416 100644 --- a/test/js/samples/each-block-keyed/expected.js +++ b/test/js/samples/each-block-keyed/expected.js @@ -96,7 +96,7 @@ function instance($$self, $$props, $$invalidate) { let { things } = $$props; $$self.$set = $$props => { - if ("things" in $$props) $$invalidate(0, things = $$props.things); + if ("things" in $$props) $$invalidate({ i: 0, ret: things = $$props.things }); }; return [things]; diff --git a/test/js/samples/event-handler-dynamic/expected.js b/test/js/samples/event-handler-dynamic/expected.js index 42c6b2951a..1a57a88f2b 100644 --- a/test/js/samples/event-handler-dynamic/expected.js +++ b/test/js/samples/event-handler-dynamic/expected.js @@ -84,11 +84,17 @@ function instance($$self, $$props, $$invalidate) { let number = 0; function updateHandler1() { - $$invalidate(0, clickHandler = () => $$invalidate(1, number = 1)); + $$invalidate({ + i: 0, + ret: clickHandler = () => $$invalidate({ i: 1, ret: number = 1 }) + }); } function updateHandler2() { - $$invalidate(0, clickHandler = () => $$invalidate(1, number = 2)); + $$invalidate({ + i: 0, + ret: clickHandler = () => $$invalidate({ i: 1, ret: number = 2 }) + }); } return [clickHandler, number, updateHandler1, updateHandler2]; diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js index f225c221bf..befc677d33 100644 --- a/test/js/samples/if-block-no-update/expected.js +++ b/test/js/samples/if-block-no-update/expected.js @@ -89,7 +89,7 @@ function instance($$self, $$props, $$invalidate) { let { foo } = $$props; $$self.$set = $$props => { - if ("foo" in $$props) $$invalidate(0, foo = $$props.foo); + if ("foo" in $$props) $$invalidate({ i: 0, ret: foo = $$props.foo }); }; return [foo]; diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js index b9fad863e2..f8a8ea6866 100644 --- a/test/js/samples/if-block-simple/expected.js +++ b/test/js/samples/if-block-simple/expected.js @@ -67,7 +67,7 @@ function instance($$self, $$props, $$invalidate) { let { foo } = $$props; $$self.$set = $$props => { - if ("foo" in $$props) $$invalidate(0, foo = $$props.foo); + if ("foo" in $$props) $$invalidate({ i: 0, ret: foo = $$props.foo }); }; return [foo]; diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js index 84a38abd7b..6b8e6c451c 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected.js +++ b/test/js/samples/inline-style-optimized-multiple/expected.js @@ -45,9 +45,9 @@ function instance($$self, $$props, $$invalidate) { let { y } = $$props; $$self.$set = $$props => { - if ("color" in $$props) $$invalidate(0, color = $$props.color); - if ("x" in $$props) $$invalidate(1, x = $$props.x); - if ("y" in $$props) $$invalidate(2, y = $$props.y); + if ("color" in $$props) $$invalidate({ i: 0, ret: color = $$props.color }); + if ("x" in $$props) $$invalidate({ i: 1, ret: x = $$props.x }); + if ("y" in $$props) $$invalidate({ i: 2, ret: y = $$props.y }); }; return [color, x, y]; diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js index 77870348a5..df7933b24b 100644 --- a/test/js/samples/inline-style-optimized-url/expected.js +++ b/test/js/samples/inline-style-optimized-url/expected.js @@ -38,7 +38,7 @@ function instance($$self, $$props, $$invalidate) { let { data } = $$props; $$self.$set = $$props => { - if ("data" in $$props) $$invalidate(0, data = $$props.data); + if ("data" in $$props) $$invalidate({ i: 0, ret: data = $$props.data }); }; return [data]; diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js index 5bef284f09..a5b59b694b 100644 --- a/test/js/samples/inline-style-optimized/expected.js +++ b/test/js/samples/inline-style-optimized/expected.js @@ -38,7 +38,7 @@ function instance($$self, $$props, $$invalidate) { let { color } = $$props; $$self.$set = $$props => { - if ("color" in $$props) $$invalidate(0, color = $$props.color); + if ("color" in $$props) $$invalidate({ i: 0, ret: color = $$props.color }); }; return [color]; diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index fdff685ead..34766666d4 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -55,9 +55,9 @@ function instance($$self, $$props, $$invalidate) { let { value } = $$props; $$self.$set = $$props => { - if ("style" in $$props) $$invalidate(0, style = $$props.style); - if ("key" in $$props) $$invalidate(1, key = $$props.key); - if ("value" in $$props) $$invalidate(2, value = $$props.value); + if ("style" in $$props) $$invalidate({ i: 0, ret: style = $$props.style }); + if ("key" in $$props) $$invalidate({ i: 1, ret: key = $$props.key }); + if ("value" in $$props) $$invalidate({ i: 2, ret: value = $$props.value }); }; return [style, key, value]; diff --git a/test/js/samples/input-files/expected.js b/test/js/samples/input-files/expected.js index c3e46f0c79..d53c1dd265 100644 --- a/test/js/samples/input-files/expected.js +++ b/test/js/samples/input-files/expected.js @@ -40,11 +40,11 @@ function instance($$self, $$props, $$invalidate) { function input_change_handler() { files = this.files; - $$invalidate(0, files); + $$invalidate({ i: 0, ret: files }); } $$self.$set = $$props => { - if ("files" in $$props) $$invalidate(0, files = $$props.files); + if ("files" in $$props) $$invalidate({ i: 0, ret: files = $$props.files }); }; return [files, input_change_handler]; diff --git a/test/js/samples/input-no-initial-value/expected.js b/test/js/samples/input-no-initial-value/expected.js index 8ff2b2798b..7f86ec5885 100644 --- a/test/js/samples/input-no-initial-value/expected.js +++ b/test/js/samples/input-no-initial-value/expected.js @@ -68,7 +68,7 @@ function instance($$self, $$props, $$invalidate) { function input_input_handler() { test = this.value; - $$invalidate(0, test); + $$invalidate({ i: 0, ret: test }); } return [test, handleSubmit, input_input_handler]; diff --git a/test/js/samples/input-range/expected.js b/test/js/samples/input-range/expected.js index 5a074d9754..0b2257d89b 100644 --- a/test/js/samples/input-range/expected.js +++ b/test/js/samples/input-range/expected.js @@ -51,11 +51,11 @@ function instance($$self, $$props, $$invalidate) { function input_change_input_handler() { value = to_number(this.value); - $$invalidate(0, value); + $$invalidate({ i: 0, ret: value }); } $$self.$set = $$props => { - if ("value" in $$props) $$invalidate(0, value = $$props.value); + if ("value" in $$props) $$invalidate({ i: 0, ret: value = $$props.value }); }; return [value, input_change_input_handler]; diff --git a/test/js/samples/input-value/expected.js b/test/js/samples/input-value/expected.js index 81753441e4..d21535c1da 100644 --- a/test/js/samples/input-value/expected.js +++ b/test/js/samples/input-value/expected.js @@ -61,7 +61,7 @@ function instance($$self, $$props, $$invalidate) { let name = "change me"; function onInput(event) { - $$invalidate(0, name = event.target.value); + $$invalidate({ i: 0, ret: name = event.target.value }); } return [name, onInput]; diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index 344976ade6..247cd90790 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -44,11 +44,11 @@ function instance($$self, $$props, $$invalidate) { function input_change_handler() { foo = this.checked; - $$invalidate(0, foo); + $$invalidate({ i: 0, ret: foo }); } $$self.$set = $$props => { - if ("foo" in $$props) $$invalidate(0, foo = $$props.foo); + if ("foo" in $$props) $$invalidate({ i: 0, ret: foo = $$props.foo }); }; return [foo, input_change_handler]; diff --git a/test/js/samples/instrumentation-script-if-no-block/expected.js b/test/js/samples/instrumentation-script-if-no-block/expected.js index 4127a6d7d6..5b58266b10 100644 --- a/test/js/samples/instrumentation-script-if-no-block/expected.js +++ b/test/js/samples/instrumentation-script-if-no-block/expected.js @@ -57,7 +57,7 @@ function instance($$self, $$props, $$invalidate) { let x = 0; function foo() { - if (true) $$invalidate(0, x += 1); + if (true) $$invalidate({ i: 0, ret: x += 1 }); } return [x, foo]; diff --git a/test/js/samples/instrumentation-script-main-block/expected.js b/test/js/samples/instrumentation-script-main-block/expected.js index bc80924602..e43e268196 100644 --- a/test/js/samples/instrumentation-script-main-block/expected.js +++ b/test/js/samples/instrumentation-script-main-block/expected.js @@ -50,15 +50,15 @@ function instance($$self, $$props, $$invalidate) { setTimeout( function foo() { - $$invalidate(0, x += 10); - $$invalidate(1, y += 20); + $$invalidate({ i: 0, ret: x += 10 }); + $$invalidate({ i: 1, ret: y += 20 }); }, 1000 ); $$self.$$.update = () => { if ($$self.$$.dirty & /*x, y*/ 3) { - $: $$invalidate(0, x += y); + $: $$invalidate({ i: 0, ret: x += y }); } }; diff --git a/test/js/samples/instrumentation-script-x-equals-x/expected.js b/test/js/samples/instrumentation-script-x-equals-x/expected.js index 0d4493baf3..47427cd902 100644 --- a/test/js/samples/instrumentation-script-x-equals-x/expected.js +++ b/test/js/samples/instrumentation-script-x-equals-x/expected.js @@ -59,7 +59,7 @@ function instance($$self, $$props, $$invalidate) { function foo() { things.push(1); - $$invalidate(0, things); + $$invalidate({ i: 0, ret: things }); } return [things, foo]; diff --git a/test/js/samples/instrumentation-template-if-no-block/expected.js b/test/js/samples/instrumentation-template-if-no-block/expected.js index 0bd627eb87..84f806f9fe 100644 --- a/test/js/samples/instrumentation-template-if-no-block/expected.js +++ b/test/js/samples/instrumentation-template-if-no-block/expected.js @@ -57,7 +57,7 @@ function instance($$self, $$props, $$invalidate) { let x = 0; const click_handler = () => { - if (true) $$invalidate(0, x += 1); + if (true) $$invalidate({ i: 0, ret: x += 1 }); }; return [x, click_handler]; diff --git a/test/js/samples/instrumentation-template-x-equals-x/expected.js b/test/js/samples/instrumentation-template-x-equals-x/expected.js index e049a6d39b..84d8787259 100644 --- a/test/js/samples/instrumentation-template-x-equals-x/expected.js +++ b/test/js/samples/instrumentation-template-x-equals-x/expected.js @@ -59,7 +59,7 @@ function instance($$self, $$props, $$invalidate) { const click_handler = () => { things.push(1); - $$invalidate(0, things); + $$invalidate({ i: 0, ret: things }); }; return [things, click_handler]; diff --git a/test/js/samples/loop-protect/expected.js b/test/js/samples/loop-protect/expected.js index 554ccf23b1..4ee6e43af1 100644 --- a/test/js/samples/loop-protect/expected.js +++ b/test/js/samples/loop-protect/expected.js @@ -104,7 +104,7 @@ function instance($$self, $$props, $$invalidate) { function div_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { - $$invalidate(0, node = $$value); + $$invalidate({ i: 0, ret: node = $$value }); }); } @@ -113,7 +113,7 @@ function instance($$self, $$props, $$invalidate) { }; $$self.$inject_state = $$props => { - if ("node" in $$props) $$invalidate(0, node = $$props.node); + if ("node" in $$props) $$invalidate({ i: 0, ret: node = $$props.node }); }; $: { diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index b5548a3efe..ed0ca4b3dc 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -109,66 +109,76 @@ function instance($$self, $$props, $$invalidate) { function audio_progress_handler() { buffered = time_ranges_to_array(this.buffered); - $$invalidate(0, buffered); + $$invalidate({ i: 0, ret: buffered }); } function audio_loadedmetadata_handler() { buffered = time_ranges_to_array(this.buffered); seekable = time_ranges_to_array(this.seekable); - $$invalidate(0, buffered); - $$invalidate(1, seekable); + $$invalidate({ i: 0, ret: buffered }); + $$invalidate({ i: 1, ret: seekable }); } function audio_timeupdate_handler() { played = time_ranges_to_array(this.played); currentTime = this.currentTime; ended = this.ended; - $$invalidate(2, played); - $$invalidate(3, currentTime); - $$invalidate(9, ended); + $$invalidate({ i: 2, ret: played }); + $$invalidate({ i: 3, ret: currentTime }); + $$invalidate({ i: 9, ret: ended }); } function audio_durationchange_handler() { duration = this.duration; - $$invalidate(4, duration); + $$invalidate({ i: 4, ret: duration }); } function audio_play_pause_handler() { paused = this.paused; - $$invalidate(5, paused); + $$invalidate({ i: 5, ret: paused }); } function audio_volumechange_handler() { volume = this.volume; - $$invalidate(6, volume); + $$invalidate({ i: 6, ret: volume }); } function audio_ratechange_handler() { playbackRate = this.playbackRate; - $$invalidate(7, playbackRate); + $$invalidate({ i: 7, ret: playbackRate }); } function audio_seeking_seeked_handler() { seeking = this.seeking; - $$invalidate(8, seeking); + $$invalidate({ i: 8, ret: seeking }); } function audio_ended_handler() { ended = this.ended; - $$invalidate(9, ended); + $$invalidate({ i: 9, ret: ended }); } $$self.$set = $$props => { - if ("buffered" in $$props) $$invalidate(0, buffered = $$props.buffered); - if ("seekable" in $$props) $$invalidate(1, seekable = $$props.seekable); - if ("played" in $$props) $$invalidate(2, played = $$props.played); - if ("currentTime" in $$props) $$invalidate(3, currentTime = $$props.currentTime); - if ("duration" in $$props) $$invalidate(4, duration = $$props.duration); - if ("paused" in $$props) $$invalidate(5, paused = $$props.paused); - if ("volume" in $$props) $$invalidate(6, volume = $$props.volume); - if ("playbackRate" in $$props) $$invalidate(7, playbackRate = $$props.playbackRate); - if ("seeking" in $$props) $$invalidate(8, seeking = $$props.seeking); - if ("ended" in $$props) $$invalidate(9, ended = $$props.ended); + if ("buffered" in $$props) $$invalidate({ i: 0, ret: buffered = $$props.buffered }); + if ("seekable" in $$props) $$invalidate({ i: 1, ret: seekable = $$props.seekable }); + if ("played" in $$props) $$invalidate({ i: 2, ret: played = $$props.played }); + + if ("currentTime" in $$props) $$invalidate({ + i: 3, + ret: currentTime = $$props.currentTime + }); + + if ("duration" in $$props) $$invalidate({ i: 4, ret: duration = $$props.duration }); + if ("paused" in $$props) $$invalidate({ i: 5, ret: paused = $$props.paused }); + if ("volume" in $$props) $$invalidate({ i: 6, ret: volume = $$props.volume }); + + if ("playbackRate" in $$props) $$invalidate({ + i: 7, + ret: playbackRate = $$props.playbackRate + }); + + if ("seeking" in $$props) $$invalidate({ i: 8, ret: seeking = $$props.seeking }); + if ("ended" in $$props) $$invalidate({ i: 9, ret: ended = $$props.ended }); }; return [ diff --git a/test/js/samples/reactive-values-non-topologically-ordered/expected.js b/test/js/samples/reactive-values-non-topologically-ordered/expected.js index 3d266f10ac..3cd3a7dedf 100644 --- a/test/js/samples/reactive-values-non-topologically-ordered/expected.js +++ b/test/js/samples/reactive-values-non-topologically-ordered/expected.js @@ -7,12 +7,12 @@ function instance($$self, $$props, $$invalidate) { let b; $$self.$set = $$props => { - if ("x" in $$props) $$invalidate(0, x = $$props.x); + if ("x" in $$props) $$invalidate({ i: 0, ret: x = $$props.x }); }; $$self.$$.update = () => { if ($$self.$$.dirty & /*x*/ 1) { - $: $$invalidate(2, b = x); + $: $$invalidate({ i: 2, ret: b = x }); } if ($$self.$$.dirty & /*b*/ 4) { diff --git a/test/js/samples/reactive-values-non-writable-dependencies/expected.js b/test/js/samples/reactive-values-non-writable-dependencies/expected.js index 38bd356d85..d477fef732 100644 --- a/test/js/samples/reactive-values-non-writable-dependencies/expected.js +++ b/test/js/samples/reactive-values-non-writable-dependencies/expected.js @@ -6,8 +6,8 @@ function instance($$self, $$props, $$invalidate) { let { b = 2 } = $$props; $$self.$set = $$props => { - if ("a" in $$props) $$invalidate(0, a = $$props.a); - if ("b" in $$props) $$invalidate(1, b = $$props.b); + if ("a" in $$props) $$invalidate({ i: 0, ret: a = $$props.a }); + if ("b" in $$props) $$invalidate({ i: 1, ret: b = $$props.b }); }; $$self.$$.update = () => { diff --git a/test/js/samples/select-dynamic-value/expected.js b/test/js/samples/select-dynamic-value/expected.js index a93a47bd3a..3deff95b3c 100644 --- a/test/js/samples/select-dynamic-value/expected.js +++ b/test/js/samples/select-dynamic-value/expected.js @@ -67,7 +67,7 @@ function instance($$self, $$props, $$invalidate) { let { current } = $$props; $$self.$set = $$props => { - if ("current" in $$props) $$invalidate(0, current = $$props.current); + if ("current" in $$props) $$invalidate({ i: 0, ret: current = $$props.current }); }; return [current]; diff --git a/test/js/samples/src-attribute-check/expected.js b/test/js/samples/src-attribute-check/expected.js index e03b3a6ba7..8ff33714b3 100644 --- a/test/js/samples/src-attribute-check/expected.js +++ b/test/js/samples/src-attribute-check/expected.js @@ -68,8 +68,8 @@ function instance($$self, $$props, $$invalidate) { let { slug } = $$props; $$self.$set = $$props => { - if ("url" in $$props) $$invalidate(0, url = $$props.url); - if ("slug" in $$props) $$invalidate(1, slug = $$props.slug); + if ("url" in $$props) $$invalidate({ i: 0, ret: url = $$props.url }); + if ("slug" in $$props) $$invalidate({ i: 1, ret: slug = $$props.slug }); }; return [url, slug]; diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js index d4e7e1a584..93e8fbb491 100644 --- a/test/js/samples/title/expected.js +++ b/test/js/samples/title/expected.js @@ -23,7 +23,7 @@ function instance($$self, $$props, $$invalidate) { let { custom } = $$props; $$self.$set = $$props => { - if ("custom" in $$props) $$invalidate(0, custom = $$props.custom); + if ("custom" in $$props) $$invalidate({ i: 0, ret: custom = $$props.custom }); }; return [custom]; diff --git a/test/js/samples/transition-local/expected.js b/test/js/samples/transition-local/expected.js index a5d3b6318f..85e745a7be 100644 --- a/test/js/samples/transition-local/expected.js +++ b/test/js/samples/transition-local/expected.js @@ -123,8 +123,8 @@ function instance($$self, $$props, $$invalidate) { let { y } = $$props; $$self.$set = $$props => { - if ("x" in $$props) $$invalidate(0, x = $$props.x); - if ("y" in $$props) $$invalidate(1, y = $$props.y); + if ("x" in $$props) $$invalidate({ i: 0, ret: x = $$props.x }); + if ("y" in $$props) $$invalidate({ i: 1, ret: y = $$props.y }); }; return [x, y]; diff --git a/test/js/samples/transition-repeated-outro/expected.js b/test/js/samples/transition-repeated-outro/expected.js index 6f071328a4..d1408464ec 100644 --- a/test/js/samples/transition-repeated-outro/expected.js +++ b/test/js/samples/transition-repeated-outro/expected.js @@ -101,7 +101,7 @@ function instance($$self, $$props, $$invalidate) { let { num = 1 } = $$props; $$self.$set = $$props => { - if ("num" in $$props) $$invalidate(0, num = $$props.num); + if ("num" in $$props) $$invalidate({ i: 0, ret: num = $$props.num }); }; return [num]; diff --git a/test/js/samples/unchanged-expression/expected.js b/test/js/samples/unchanged-expression/expected.js index 673d5b6abc..01198e7e46 100644 --- a/test/js/samples/unchanged-expression/expected.js +++ b/test/js/samples/unchanged-expression/expected.js @@ -76,7 +76,7 @@ function instance($$self, $$props, $$invalidate) { const world3 = "world"; function foo() { - $$invalidate(0, world3 = "svelte"); + $$invalidate({ i: 0, ret: world3 = "svelte" }); } return [world3]; diff --git a/test/js/samples/unreferenced-state-not-invalidated/expected.js b/test/js/samples/unreferenced-state-not-invalidated/expected.js index b10ea815b9..04dc3cba42 100644 --- a/test/js/samples/unreferenced-state-not-invalidated/expected.js +++ b/test/js/samples/unreferenced-state-not-invalidated/expected.js @@ -44,7 +44,7 @@ function instance($$self, $$props, $$invalidate) { onMount(() => { const interval = setInterval( () => { - $$invalidate(1, b += 1); + $$invalidate({ i: 1, ret: b += 1 }); c += 1; console.log(b, c); }, @@ -59,7 +59,7 @@ function instance($$self, $$props, $$invalidate) { $$self.$$.update = () => { if ($$self.$$.dirty & /*b*/ 2) { - $: $$invalidate(0, y = b * 2); + $: $$invalidate({ i: 0, ret: y = b * 2 }); } }; diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js index 52635e9b78..3bb4dde93a 100644 --- a/test/js/samples/use-elements-as-anchors/expected.js +++ b/test/js/samples/use-elements-as-anchors/expected.js @@ -244,11 +244,11 @@ function instance($$self, $$props, $$invalidate) { let { e } = $$props; $$self.$set = $$props => { - if ("a" in $$props) $$invalidate(0, a = $$props.a); - if ("b" in $$props) $$invalidate(1, b = $$props.b); - if ("c" in $$props) $$invalidate(2, c = $$props.c); - if ("d" in $$props) $$invalidate(3, d = $$props.d); - if ("e" in $$props) $$invalidate(4, e = $$props.e); + if ("a" in $$props) $$invalidate({ i: 0, ret: a = $$props.a }); + if ("b" in $$props) $$invalidate({ i: 1, ret: b = $$props.b }); + if ("c" in $$props) $$invalidate({ i: 2, ret: c = $$props.c }); + if ("d" in $$props) $$invalidate({ i: 3, ret: d = $$props.d }); + if ("e" in $$props) $$invalidate({ i: 4, ret: e = $$props.e }); }; return [a, b, c, d, e]; diff --git a/test/js/samples/video-bindings/expected.js b/test/js/samples/video-bindings/expected.js index 5b734a70a6..d2a45c8ef0 100644 --- a/test/js/samples/video-bindings/expected.js +++ b/test/js/samples/video-bindings/expected.js @@ -72,26 +72,41 @@ function instance($$self, $$props, $$invalidate) { function video_timeupdate_handler() { currentTime = this.currentTime; - $$invalidate(0, currentTime); + $$invalidate({ i: 0, ret: currentTime }); } function video_resize_handler() { videoHeight = this.videoHeight; videoWidth = this.videoWidth; - $$invalidate(1, videoHeight); - $$invalidate(2, videoWidth); + $$invalidate({ i: 1, ret: videoHeight }); + $$invalidate({ i: 2, ret: videoWidth }); } function video_elementresize_handler() { offsetWidth = this.offsetWidth; - $$invalidate(3, offsetWidth); + $$invalidate({ i: 3, ret: offsetWidth }); } $$self.$set = $$props => { - if ("currentTime" in $$props) $$invalidate(0, currentTime = $$props.currentTime); - if ("videoHeight" in $$props) $$invalidate(1, videoHeight = $$props.videoHeight); - if ("videoWidth" in $$props) $$invalidate(2, videoWidth = $$props.videoWidth); - if ("offsetWidth" in $$props) $$invalidate(3, offsetWidth = $$props.offsetWidth); + if ("currentTime" in $$props) $$invalidate({ + i: 0, + ret: currentTime = $$props.currentTime + }); + + if ("videoHeight" in $$props) $$invalidate({ + i: 1, + ret: videoHeight = $$props.videoHeight + }); + + if ("videoWidth" in $$props) $$invalidate({ + i: 2, + ret: videoWidth = $$props.videoWidth + }); + + if ("offsetWidth" in $$props) $$invalidate({ + i: 3, + ret: offsetWidth = $$props.offsetWidth + }); }; return [ diff --git a/test/js/samples/window-binding-online/expected.js b/test/js/samples/window-binding-online/expected.js index 8285646481..f70b40d872 100644 --- a/test/js/samples/window-binding-online/expected.js +++ b/test/js/samples/window-binding-online/expected.js @@ -34,7 +34,7 @@ function instance($$self, $$props, $$invalidate) { let online; function onlinestatuschanged() { - $$invalidate(0, online = navigator.onLine); + $$invalidate({ i: 0, ret: online = navigator.onLine }); } return [online, onlinestatuschanged]; diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js index f79212e25e..cfe127fc62 100644 --- a/test/js/samples/window-binding-scroll/expected.js +++ b/test/js/samples/window-binding-scroll/expected.js @@ -69,11 +69,11 @@ function instance($$self, $$props, $$invalidate) { let { y } = $$props; function onwindowscroll() { - $$invalidate(0, y = window.pageYOffset) + $$invalidate({ i: 0, ret: y = window.pageYOffset }) } $$self.$set = $$props => { - if ("y" in $$props) $$invalidate(0, y = $$props.y); + if ("y" in $$props) $$invalidate({ i: 0, ret: y = $$props.y }); }; return [y, onwindowscroll]; diff --git a/test/runtime/samples/store-undefined-destructuring/_config.js b/test/runtime/samples/store-undefined-destructuring/_config.js new file mode 100644 index 0000000000..9a6a2c9861 --- /dev/null +++ b/test/runtime/samples/store-undefined-destructuring/_config.js @@ -0,0 +1,13 @@ +import { writable } from '../../../../store'; + +export default { + props: { + store: writable({}) + }, + + test({ assert, target }) { + assert.htmlEqual(target.innerHTML, ` + undefined + `); + } +}; diff --git a/test/runtime/samples/store-undefined-destructuring/main.svelte b/test/runtime/samples/store-undefined-destructuring/main.svelte new file mode 100644 index 0000000000..c7f5b0d01c --- /dev/null +++ b/test/runtime/samples/store-undefined-destructuring/main.svelte @@ -0,0 +1,7 @@ + + +{undefinedProperty}