diff --git a/test/js/samples/action-custom-event-handler/expected.js b/test/js/samples/action-custom-event-handler/expected.js
index 8b0241ed47..acbf370e81 100644
--- a/test/js/samples/action-custom-event-handler/expected.js
+++ b/test/js/samples/action-custom-event-handler/expected.js
@@ -43,32 +43,32 @@ function foo(node, callback) {
// code goes here
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { bar } = $$props;
function foo_function() {
return handleFoo(bar);
}
- $$self.$$.get = () => ({ bar, foo_function });
-
$$self.$$.set = $$props => {
if ('bar' in $$props) bar = $$props.bar;
};
+
+ return { bar, foo_function };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get bar() {
- return this.$$.get().bar;
+ return this.$$.ctx.bar;
}
- set bar(value) {
- this.$set({ bar: value });
+ set bar(bar) {
+ this.$set({ bar });
flush();
}
}
diff --git a/test/js/samples/action/expected.js b/test/js/samples/action/expected.js
index 97f776295a..c1f2c2788b 100644
--- a/test/js/samples/action/expected.js
+++ b/test/js/samples/action/expected.js
@@ -54,7 +54,7 @@ function link(node) {
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, noop, create_fragment, safe_not_equal);
+ init(this, options, props => props, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/bind-width-height/expected.js b/test/js/samples/bind-width-height/expected.js
index 65c9bf9f14..f97a6d81e5 100644
--- a/test/js/samples/bind-width-height/expected.js
+++ b/test/js/samples/bind-width-height/expected.js
@@ -36,45 +36,45 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let { w, h } = $$props;
function div_resize_handler() {
w = this.offsetWidth;
h = this.offsetHeight;
- $$make_dirty('w');
- $$make_dirty('h');
+ $$invalidate('w', w);
+ $$invalidate('h', h);
}
- $$self.$$.get = () => ({ w, h, div_resize_handler });
-
$$self.$$.set = $$props => {
if ('w' in $$props) w = $$props.w;
if ('h' in $$props) h = $$props.h;
};
+
+ return { w, h, div_resize_handler };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get w() {
- return this.$$.get().w;
+ return this.$$.ctx.w;
}
- set w(value) {
- this.$set({ w: value });
+ set w(w) {
+ this.$set({ w });
flush();
}
get h() {
- return this.$$.get().h;
+ return this.$$.ctx.h;
}
- set h(value) {
- this.$set({ h: value });
+ set h(h) {
+ this.$set({ h });
flush();
}
}
diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js
index 4d13bfe165..4e086edb68 100644
--- a/test/js/samples/collapses-text-around-comments/expected.js
+++ b/test/js/samples/collapses-text-around-comments/expected.js
@@ -45,29 +45,29 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { foo = 42 } = $$props;
- $$self.$$.get = () => ({ foo });
-
$$self.$$.set = $$props => {
if ('foo' in $$props) foo = $$props.foo;
};
+
+ return { foo };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get foo() {
- return this.$$.get().foo;
+ return this.$$.ctx.foo;
}
- set foo(value) {
- this.$set({ foo: value });
+ set foo(foo) {
+ this.$set({ foo });
flush();
}
}
diff --git a/test/js/samples/component-static-array/expected.js b/test/js/samples/component-static-array/expected.js
index abbde3284c..8fbc4a6b2d 100644
--- a/test/js/samples/component-static-array/expected.js
+++ b/test/js/samples/component-static-array/expected.js
@@ -36,16 +36,16 @@ function create_fragment(component, ctx) {
};
}
-function define($$self) {
+function instance($$self) {
const Nested = window.Nested;
- $$self.$$.get = () => ({ Nested });
+ return { Nested };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/component-static-immutable/expected.js b/test/js/samples/component-static-immutable/expected.js
index 71cb810a5d..545b857699 100644
--- a/test/js/samples/component-static-immutable/expected.js
+++ b/test/js/samples/component-static-immutable/expected.js
@@ -36,16 +36,16 @@ function create_fragment(component, ctx) {
};
}
-function define($$self) {
+function instance($$self) {
const Nested = window.Nested;
- $$self.$$.get = () => ({ Nested });
+ return { Nested };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, not_equal);
+ init(this, options, instance, create_fragment, not_equal);
}
}
diff --git a/test/js/samples/component-static-immutable2/expected.js b/test/js/samples/component-static-immutable2/expected.js
index 71cb810a5d..545b857699 100644
--- a/test/js/samples/component-static-immutable2/expected.js
+++ b/test/js/samples/component-static-immutable2/expected.js
@@ -36,16 +36,16 @@ function create_fragment(component, ctx) {
};
}
-function define($$self) {
+function instance($$self) {
const Nested = window.Nested;
- $$self.$$.get = () => ({ Nested });
+ return { Nested };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, not_equal);
+ init(this, options, instance, create_fragment, not_equal);
}
}
diff --git a/test/js/samples/component-static/expected.js b/test/js/samples/component-static/expected.js
index 6f53c66d88..1f888cc8f7 100644
--- a/test/js/samples/component-static/expected.js
+++ b/test/js/samples/component-static/expected.js
@@ -36,16 +36,16 @@ function create_fragment(component, ctx) {
};
}
-function define($$self) {
+function instance($$self) {
const Nested = window.Nested;
- $$self.$$.get = () => ({ Nested });
+ return { Nested };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js
index 14b0dfe978..22e3fbcf31 100644
--- a/test/js/samples/computed-collapsed-if/expected.js
+++ b/test/js/samples/computed-collapsed-if/expected.js
@@ -14,7 +14,7 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { x } = $$props;
function a() {
@@ -25,34 +25,34 @@ function define($$self, $$props) {
return x * 3;
}
- $$self.$$.get = () => ({ x, a, b });
-
$$self.$$.set = $$props => {
if ('x' in $$props) x = $$props.x;
};
+
+ return { x, a, b };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get x() {
- return this.$$.get().x;
+ return this.$$.ctx.x;
}
- set x(value) {
- this.$set({ x: value });
+ set x(x) {
+ this.$set({ x });
flush();
}
get a() {
- return this.$$.get().a;
+ return this.$$.ctx.a;
}
get b() {
- return this.$$.get().b;
+ return this.$$.ctx.b;
}
}
diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js
index 4a9c0e2c4a..389da1f450 100644
--- a/test/js/samples/css-media-query/expected.js
+++ b/test/js/samples/css-media-query/expected.js
@@ -43,7 +43,7 @@ class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
if (!document.getElementById("svelte-1slhpfn-style")) add_css();
- init(this, options, noop, create_fragment, safe_not_equal);
+ init(this, options, props => props, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js
index ccc35138fd..9dd4bdf182 100644
--- a/test/js/samples/css-shadow-dom-keyframes/expected.js
+++ b/test/js/samples/css-shadow-dom-keyframes/expected.js
@@ -39,7 +39,7 @@ class SvelteComponent extends SvelteElement {
this.shadowRoot.innerHTML = ``;
- init(this, { target: this.shadowRoot }, noop, create_fragment, safe_not_equal);
+ init(this, { target: this.shadowRoot }, props => props, create_fragment, safe_not_equal);
if (options) {
if (options.target) {
diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js
index 1dd048bcf7..424221040a 100644
--- a/test/js/samples/debug-empty/expected.js
+++ b/test/js/samples/debug-empty/expected.js
@@ -54,33 +54,33 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { name } = $$props;
- $$self.$$.get = () => ({ name });
-
$$self.$$.set = $$props => {
if ('name' in $$props) name = $$props.name;
};
+
+ return { name };
}
class SvelteComponent extends SvelteComponentDev {
constructor(options) {
super(options);
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
- const state = this.$$.get();
- if (state.name === undefined) {
+ const { ctx } = this.$$;
+ if (ctx.name === undefined) {
console.warn(" was created without expected data property 'name'");
}
}
get name() {
- return this.$$.get().name;
+ return this.$$.ctx.name;
}
- set name(value) {
- this.$set({ name: value });
+ set name(name) {
+ this.$set({ name });
flush();
}
}
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 e5db443057..c53273146e 100644
--- a/test/js/samples/debug-foo-bar-baz-things/expected.js
+++ b/test/js/samples/debug-foo-bar-baz-things/expected.js
@@ -139,72 +139,72 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { things, foo, bar, baz } = $$props;
- $$self.$$.get = () => ({ things, foo, bar, baz });
-
$$self.$$.set = $$props => {
if ('things' in $$props) things = $$props.things;
if ('foo' in $$props) foo = $$props.foo;
if ('bar' in $$props) bar = $$props.bar;
if ('baz' in $$props) baz = $$props.baz;
};
+
+ return { things, foo, bar, baz };
}
class SvelteComponent extends SvelteComponentDev {
constructor(options) {
super(options);
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
- const state = this.$$.get();
- if (state.things === undefined) {
+ const { ctx } = this.$$;
+ if (ctx.things === undefined) {
console.warn(" was created without expected data property 'things'");
}
- if (state.foo === undefined) {
+ if (ctx.foo === undefined) {
console.warn(" was created without expected data property 'foo'");
}
- if (state.bar === undefined) {
+ if (ctx.bar === undefined) {
console.warn(" was created without expected data property 'bar'");
}
- if (state.baz === undefined) {
+ if (ctx.baz === undefined) {
console.warn(" was created without expected data property 'baz'");
}
}
get things() {
- return this.$$.get().things;
+ return this.$$.ctx.things;
}
- set things(value) {
- this.$set({ things: value });
+ set things(things) {
+ this.$set({ things });
flush();
}
get foo() {
- return this.$$.get().foo;
+ return this.$$.ctx.foo;
}
- set foo(value) {
- this.$set({ foo: value });
+ set foo(foo) {
+ this.$set({ foo });
flush();
}
get bar() {
- return this.$$.get().bar;
+ return this.$$.ctx.bar;
}
- set bar(value) {
- this.$set({ bar: value });
+ set bar(bar) {
+ this.$set({ bar });
flush();
}
get baz() {
- return this.$$.get().baz;
+ return this.$$.ctx.baz;
}
- set baz(value) {
- this.$set({ baz: value });
+ set baz(baz) {
+ this.$set({ baz });
flush();
}
}
diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js
index eecd79c38d..82df828323 100644
--- a/test/js/samples/debug-foo/expected.js
+++ b/test/js/samples/debug-foo/expected.js
@@ -139,46 +139,46 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { things, foo } = $$props;
- $$self.$$.get = () => ({ things, foo });
-
$$self.$$.set = $$props => {
if ('things' in $$props) things = $$props.things;
if ('foo' in $$props) foo = $$props.foo;
};
+
+ return { things, foo };
}
class SvelteComponent extends SvelteComponentDev {
constructor(options) {
super(options);
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
- const state = this.$$.get();
- if (state.things === undefined) {
+ const { ctx } = this.$$;
+ if (ctx.things === undefined) {
console.warn(" was created without expected data property 'things'");
}
- if (state.foo === undefined) {
+ if (ctx.foo === undefined) {
console.warn(" was created without expected data property 'foo'");
}
}
get things() {
- return this.$$.get().things;
+ return this.$$.ctx.things;
}
- set things(value) {
- this.$set({ things: value });
+ set things(things) {
+ this.$set({ things });
flush();
}
get foo() {
- return this.$$.get().foo;
+ return this.$$.ctx.foo;
}
- set foo(value) {
- this.$set({ foo: value });
+ set foo(foo) {
+ this.$set({ foo });
flush();
}
}
diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js
index 75fd699f2d..613bdb712b 100644
--- a/test/js/samples/deconflict-builtins/expected.js
+++ b/test/js/samples/deconflict-builtins/expected.js
@@ -105,28 +105,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { createElement } = $$props;
- $$self.$$.get = () => ({ createElement });
-
$$self.$$.set = $$props => {
if ('createElement' in $$props) createElement = $$props.createElement;
};
+
+ return { createElement };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get createElement() {
- return this.$$.get().createElement;
+ return this.$$.ctx.createElement;
}
- set createElement(value) {
- this.$set({ createElement: value });
+ set createElement(createElement) {
+ this.$set({ createElement });
flush();
}
}
diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js
index 28f0013dec..aab54e874e 100644
--- a/test/js/samples/deconflict-globals/expected.js
+++ b/test/js/samples/deconflict-globals/expected.js
@@ -15,32 +15,32 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { foo = 'bar' } = $$props;
onMount(() => {
alert(JSON.stringify(data()));
});
- $$self.$$.get = () => ({ foo });
-
$$self.$$.set = $$props => {
if ('foo' in $$props) foo = $$props.foo;
};
+
+ return { foo };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get foo() {
- return this.$$.get().foo;
+ return this.$$.ctx.foo;
}
- set foo(value) {
- this.$set({ foo: value });
+ set foo(foo) {
+ this.$set({ foo });
flush();
}
}
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 82db1b23d2..c77cac7174 100644
--- a/test/js/samples/dev-warning-missing-data-computed/expected.js
+++ b/test/js/samples/dev-warning-missing-data-computed/expected.js
@@ -52,41 +52,41 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let { foo } = $$props;
let bar;
- $$self.$$.get = () => ({ foo, bar });
-
$$self.$$.set = $$props => {
if ('foo' in $$props) foo = $$props.foo;
};
$$self.$$.update = ($$dirty = { foo: 1 }) => {
if ($$dirty.foo) {
- bar = foo * 2; $$make_dirty('bar');
+ bar = foo * 2; $$invalidate('bar', bar);
}
};
+
+ return { foo, bar };
}
class SvelteComponent extends SvelteComponentDev {
constructor(options) {
super(options);
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
- const state = this.$$.get();
- if (state.foo === undefined) {
+ const { ctx } = this.$$;
+ if (ctx.foo === undefined) {
console.warn(" was created without expected data property 'foo'");
}
}
get foo() {
- return this.$$.get().foo;
+ return this.$$.ctx.foo;
}
- set foo(value) {
- this.$set({ foo: value });
+ set foo(foo) {
+ this.$set({ foo });
flush();
}
}
diff --git a/test/js/samples/do-use-dataset/expected.js b/test/js/samples/do-use-dataset/expected.js
index 45a433a52f..47249c25ee 100644
--- a/test/js/samples/do-use-dataset/expected.js
+++ b/test/js/samples/do-use-dataset/expected.js
@@ -43,28 +43,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { bar } = $$props;
- $$self.$$.get = () => ({ bar });
-
$$self.$$.set = $$props => {
if ('bar' in $$props) bar = $$props.bar;
};
+
+ return { bar };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get bar() {
- return this.$$.get().bar;
+ return this.$$.ctx.bar;
}
- set bar(value) {
- this.$set({ bar: value });
+ set bar(bar) {
+ this.$set({ bar });
flush();
}
}
diff --git a/test/js/samples/dont-use-dataset-in-legacy/expected.js b/test/js/samples/dont-use-dataset-in-legacy/expected.js
index 77ad33739e..d1ef2aeb78 100644
--- a/test/js/samples/dont-use-dataset-in-legacy/expected.js
+++ b/test/js/samples/dont-use-dataset-in-legacy/expected.js
@@ -43,28 +43,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { bar } = $$props;
- $$self.$$.get = () => ({ bar });
-
$$self.$$.set = $$props => {
if ('bar' in $$props) bar = $$props.bar;
};
+
+ return { bar };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get bar() {
- return this.$$.get().bar;
+ return this.$$.ctx.bar;
}
- set bar(value) {
- this.$set({ bar: value });
+ set bar(bar) {
+ this.$set({ bar });
flush();
}
}
diff --git a/test/js/samples/dont-use-dataset-in-svg/expected.js b/test/js/samples/dont-use-dataset-in-svg/expected.js
index 3caed4ad32..de9f6e587d 100644
--- a/test/js/samples/dont-use-dataset-in-svg/expected.js
+++ b/test/js/samples/dont-use-dataset-in-svg/expected.js
@@ -41,28 +41,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { bar } = $$props;
- $$self.$$.get = () => ({ bar });
-
$$self.$$.set = $$props => {
if ('bar' in $$props) bar = $$props.bar;
};
+
+ return { bar };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get bar() {
- return this.$$.get().bar;
+ return this.$$.ctx.bar;
}
- set bar(value) {
- this.$set({ bar: value });
+ set bar(bar) {
+ this.$set({ bar });
flush();
}
}
diff --git a/test/js/samples/dynamic-import/expected.js b/test/js/samples/dynamic-import/expected.js
index 80775a2fb1..cfcc48e9cc 100644
--- a/test/js/samples/dynamic-import/expected.js
+++ b/test/js/samples/dynamic-import/expected.js
@@ -44,7 +44,7 @@ function func() {
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, noop, create_fragment, safe_not_equal);
+ init(this, options, props => props, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js
index e2a0900cc5..42d4afea00 100644
--- a/test/js/samples/each-block-changed-check/expected.js
+++ b/test/js/samples/each-block-changed-check/expected.js
@@ -145,58 +145,58 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { comments, elapsed, time, foo } = $$props;
- $$self.$$.get = () => ({ comments, elapsed, time, foo });
-
$$self.$$.set = $$props => {
if ('comments' in $$props) comments = $$props.comments;
if ('elapsed' in $$props) elapsed = $$props.elapsed;
if ('time' in $$props) time = $$props.time;
if ('foo' in $$props) foo = $$props.foo;
};
+
+ return { comments, elapsed, time, foo };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get comments() {
- return this.$$.get().comments;
+ return this.$$.ctx.comments;
}
- set comments(value) {
- this.$set({ comments: value });
+ set comments(comments) {
+ this.$set({ comments });
flush();
}
get elapsed() {
- return this.$$.get().elapsed;
+ return this.$$.ctx.elapsed;
}
- set elapsed(value) {
- this.$set({ elapsed: value });
+ set elapsed(elapsed) {
+ this.$set({ elapsed });
flush();
}
get time() {
- return this.$$.get().time;
+ return this.$$.ctx.time;
}
- set time(value) {
- this.$set({ time: value });
+ set time(time) {
+ this.$set({ time });
flush();
}
get foo() {
- return this.$$.get().foo;
+ return this.$$.ctx.foo;
}
- set foo(value) {
- this.$set({ foo: value });
+ set foo(foo) {
+ this.$set({ foo });
flush();
}
}
diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js
index 17dcc7bdd7..18227c1cee 100644
--- a/test/js/samples/each-block-keyed-animated/expected.js
+++ b/test/js/samples/each-block-keyed-animated/expected.js
@@ -120,28 +120,28 @@ function foo(node, animation, params) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { things } = $$props;
- $$self.$$.get = () => ({ things });
-
$$self.$$.set = $$props => {
if ('things' in $$props) things = $$props.things;
};
+
+ return { things };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get things() {
- return this.$$.get().things;
+ return this.$$.ctx.things;
}
- set things(value) {
- this.$set({ things: value });
+ set things(things) {
+ this.$set({ things });
flush();
}
}
diff --git a/test/js/samples/each-block-keyed/expected.js b/test/js/samples/each-block-keyed/expected.js
index 86cd56d3c7..77becc6b94 100644
--- a/test/js/samples/each-block-keyed/expected.js
+++ b/test/js/samples/each-block-keyed/expected.js
@@ -90,28 +90,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { things } = $$props;
- $$self.$$.get = () => ({ things });
-
$$self.$$.set = $$props => {
if ('things' in $$props) things = $$props.things;
};
+
+ return { things };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get things() {
- return this.$$.get().things;
+ return this.$$.ctx.things;
}
- set things(value) {
- this.$set({ things: value });
+ set things(things) {
+ this.$set({ things });
flush();
}
}
diff --git a/test/js/samples/event-modifiers/expected.js b/test/js/samples/event-modifiers/expected.js
index edb933ce31..824492d6e8 100644
--- a/test/js/samples/event-modifiers/expected.js
+++ b/test/js/samples/event-modifiers/expected.js
@@ -63,7 +63,7 @@ function handleClick() {
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, noop, create_fragment, safe_not_equal);
+ init(this, options, props => props, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/head-no-whitespace/expected.js b/test/js/samples/head-no-whitespace/expected.js
index a7c076ba95..98939fbc8a 100644
--- a/test/js/samples/head-no-whitespace/expected.js
+++ b/test/js/samples/head-no-whitespace/expected.js
@@ -39,7 +39,7 @@ function create_fragment(component, ctx) {
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, noop, create_fragment, safe_not_equal);
+ init(this, options, props => props, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/hoisted-const/expected.js b/test/js/samples/hoisted-const/expected.js
index 4613e724d7..da524f21d5 100644
--- a/test/js/samples/hoisted-const/expected.js
+++ b/test/js/samples/hoisted-const/expected.js
@@ -40,7 +40,7 @@ function get_answer() { return ANSWER; }
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, noop, create_fragment, safe_not_equal);
+ init(this, options, props => props, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js
index 6c0752b451..f6b460ab87 100644
--- a/test/js/samples/if-block-no-update/expected.js
+++ b/test/js/samples/if-block-no-update/expected.js
@@ -93,28 +93,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { foo } = $$props;
- $$self.$$.get = () => ({ foo });
-
$$self.$$.set = $$props => {
if ('foo' in $$props) foo = $$props.foo;
};
+
+ return { foo };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get foo() {
- return this.$$.get().foo;
+ return this.$$.ctx.foo;
}
- set foo(value) {
- this.$set({ foo: value });
+ set foo(foo) {
+ this.$set({ foo });
flush();
}
}
diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js
index 28ef59efd0..a7c2f6b460 100644
--- a/test/js/samples/if-block-simple/expected.js
+++ b/test/js/samples/if-block-simple/expected.js
@@ -69,28 +69,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { foo } = $$props;
- $$self.$$.get = () => ({ foo });
-
$$self.$$.set = $$props => {
if ('foo' in $$props) foo = $$props.foo;
};
+
+ return { foo };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get foo() {
- return this.$$.get().foo;
+ return this.$$.ctx.foo;
}
- set foo(value) {
- this.$set({ foo: value });
+ set foo(foo) {
+ this.$set({ foo });
flush();
}
}
diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js
index 3f4240ee4e..92804c1983 100644
--- a/test/js/samples/inline-style-optimized-multiple/expected.js
+++ b/test/js/samples/inline-style-optimized-multiple/expected.js
@@ -41,48 +41,48 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { color, x, y } = $$props;
- $$self.$$.get = () => ({ color, x, y });
-
$$self.$$.set = $$props => {
if ('color' in $$props) color = $$props.color;
if ('x' in $$props) x = $$props.x;
if ('y' in $$props) y = $$props.y;
};
+
+ return { color, x, y };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get color() {
- return this.$$.get().color;
+ return this.$$.ctx.color;
}
- set color(value) {
- this.$set({ color: value });
+ set color(color) {
+ this.$set({ color });
flush();
}
get x() {
- return this.$$.get().x;
+ return this.$$.ctx.x;
}
- set x(value) {
- this.$set({ x: value });
+ set x(x) {
+ this.$set({ x });
flush();
}
get y() {
- return this.$$.get().y;
+ return this.$$.ctx.y;
}
- set y(value) {
- this.$set({ y: value });
+ set y(y) {
+ this.$set({ y });
flush();
}
}
diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js
index 3a14088491..992d072638 100644
--- a/test/js/samples/inline-style-optimized-url/expected.js
+++ b/test/js/samples/inline-style-optimized-url/expected.js
@@ -36,28 +36,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { data } = $$props;
- $$self.$$.get = () => ({ data });
-
$$self.$$.set = $$props => {
if ('data' in $$props) data = $$props.data;
};
+
+ return { data };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get data() {
- return this.$$.get().data;
+ return this.$$.ctx.data;
}
- set data(value) {
- this.$set({ data: value });
+ set data(data) {
+ this.$set({ data });
flush();
}
}
diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js
index 27774b1018..fcf7a926fc 100644
--- a/test/js/samples/inline-style-optimized/expected.js
+++ b/test/js/samples/inline-style-optimized/expected.js
@@ -36,28 +36,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { color } = $$props;
- $$self.$$.get = () => ({ color });
-
$$self.$$.set = $$props => {
if ('color' in $$props) color = $$props.color;
};
+
+ return { color };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get color() {
- return this.$$.get().color;
+ return this.$$.ctx.color;
}
- set color(value) {
- this.$set({ color: value });
+ set color(color) {
+ this.$set({ color });
flush();
}
}
diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js
index 8827c97897..b28fef6680 100644
--- a/test/js/samples/inline-style-unoptimized/expected.js
+++ b/test/js/samples/inline-style-unoptimized/expected.js
@@ -47,48 +47,48 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { style, key, value } = $$props;
- $$self.$$.get = () => ({ style, key, value });
-
$$self.$$.set = $$props => {
if ('style' in $$props) style = $$props.style;
if ('key' in $$props) key = $$props.key;
if ('value' in $$props) value = $$props.value;
};
+
+ return { style, key, value };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get style() {
- return this.$$.get().style;
+ return this.$$.ctx.style;
}
- set style(value) {
- this.$set({ style: value });
+ set style(style) {
+ this.$set({ style });
flush();
}
get key() {
- return this.$$.get().key;
+ return this.$$.ctx.key;
}
- set key(value) {
- this.$set({ key: value });
+ set key(key) {
+ this.$set({ key });
flush();
}
get value() {
- return this.$$.get().value;
+ return this.$$.ctx.value;
}
set value(value) {
- this.$set({ value: value });
+ this.$set({ value });
flush();
}
}
diff --git a/test/js/samples/input-files/expected.js b/test/js/samples/input-files/expected.js
index acfc8c3866..bf8c9fac76 100644
--- a/test/js/samples/input-files/expected.js
+++ b/test/js/samples/input-files/expected.js
@@ -41,33 +41,33 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let { files } = $$props;
function input_input_handler() {
files = this.files;
- $$make_dirty('files');
+ $$invalidate('files', files);
}
- $$self.$$.get = () => ({ files, input_input_handler });
-
$$self.$$.set = $$props => {
if ('files' in $$props) files = $$props.files;
};
+
+ return { files, input_input_handler };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get files() {
- return this.$$.get().files;
+ return this.$$.ctx.files;
}
- set files(value) {
- this.$set({ files: value });
+ set files(files) {
+ this.$set({ files });
flush();
}
}
diff --git a/test/js/samples/input-range/expected.js b/test/js/samples/input-range/expected.js
index 4f1d79991c..18c54e508e 100644
--- a/test/js/samples/input-range/expected.js
+++ b/test/js/samples/input-range/expected.js
@@ -44,33 +44,33 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let { value } = $$props;
function input_change_input_handler() {
value = toNumber(this.value);
- $$make_dirty('value');
+ $$invalidate('value', value);
}
- $$self.$$.get = () => ({ value, input_change_input_handler });
-
$$self.$$.set = $$props => {
if ('value' in $$props) value = $$props.value;
};
+
+ return { value, input_change_input_handler };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get value() {
- return this.$$.get().value;
+ return this.$$.ctx.value;
}
set value(value) {
- this.$set({ value: value });
+ this.$set({ value });
flush();
}
}
diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js
index 8dc8db1088..2c11490964 100644
--- a/test/js/samples/input-without-blowback-guard/expected.js
+++ b/test/js/samples/input-without-blowback-guard/expected.js
@@ -40,33 +40,33 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let { foo } = $$props;
function input_change_handler() {
foo = this.checked;
- $$make_dirty('foo');
+ $$invalidate('foo', foo);
}
- $$self.$$.get = () => ({ foo, input_change_handler });
-
$$self.$$.set = $$props => {
if ('foo' in $$props) foo = $$props.foo;
};
+
+ return { foo, input_change_handler };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get foo() {
- return this.$$.get().foo;
+ return this.$$.ctx.foo;
}
- set foo(value) {
- this.$set({ foo: value });
+ set foo(foo) {
+ this.$set({ foo });
flush();
}
}
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 e58b54f626..0d1b0b9780 100644
--- a/test/js/samples/instrumentation-script-if-no-block/expected.js
+++ b/test/js/samples/instrumentation-script-if-no-block/expected.js
@@ -49,20 +49,20 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let x = 0;
function foo() {
- if (true) { x += 1; $$make_dirty('x'); }
+ if (true) { x += 1; $$invalidate('x', x); }
}
- $$self.$$.get = () => ({ x, foo });
+ return { x, foo };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
}
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 6b941101d6..221088fef5 100644
--- a/test/js/samples/instrumentation-script-x-equals-x/expected.js
+++ b/test/js/samples/instrumentation-script-x-equals-x/expected.js
@@ -49,21 +49,21 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let things = [];
function foo() {
things.push(1);
- $$make_dirty('things');
+ $$invalidate('things', things);
}
- $$self.$$.get = () => ({ things, foo });
+ return { things, foo };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
}
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 bbf81ac336..b1b4a5b8ce 100644
--- a/test/js/samples/instrumentation-template-if-no-block/expected.js
+++ b/test/js/samples/instrumentation-template-if-no-block/expected.js
@@ -49,20 +49,20 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let x = 0;
function click_handler() {
- if (true) { x += 1; $$make_dirty('x'); }
+ if (true) { x += 1; $$invalidate('x', x); }
}
- $$self.$$.get = () => ({ x, click_handler });
+ return { x, click_handler };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
}
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 759cafbb51..8dbcb10263 100644
--- a/test/js/samples/instrumentation-template-x-equals-x/expected.js
+++ b/test/js/samples/instrumentation-template-x-equals-x/expected.js
@@ -49,18 +49,18 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let things = [];
- function click_handler() { things.push(1); $$make_dirty('things') }
+ function click_handler() { things.push(1); $$invalidate('things', things) }
- $$self.$$.get = () => ({ things, click_handler });
+ return { things, click_handler };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/legacy-input-type/expected.js b/test/js/samples/legacy-input-type/expected.js
index 05c739d846..44e0cea9d2 100644
--- a/test/js/samples/legacy-input-type/expected.js
+++ b/test/js/samples/legacy-input-type/expected.js
@@ -35,7 +35,7 @@ function create_fragment(component, ctx) {
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, noop, create_fragment, safe_not_equal);
+ init(this, options, props => props, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js
index f3c888ccb9..9815abc548 100644
--- a/test/js/samples/media-bindings/expected.js
+++ b/test/js/samples/media-bindings/expected.js
@@ -54,7 +54,7 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let { buffered, seekable, played, currentTime, duration, paused, volume } = $$props;
function audio_timeupdate_handler() {
@@ -62,38 +62,48 @@ function define($$self, $$props, $$make_dirty) {
if (!audio.paused) audio_animationframe = requestAnimationFrame(audio_timeupdate_handler);
played = timeRangesToArray(this.played);
currentTime = this.currentTime;
- $$make_dirty('played');
- $$make_dirty('currentTime');
+ $$invalidate('played', played);
+ $$invalidate('currentTime', currentTime);
}
function audio_durationchange_handler() {
duration = this.duration;
- $$make_dirty('duration');
+ $$invalidate('duration', duration);
}
function audio_play_pause_handler() {
paused = this.paused;
- $$make_dirty('paused');
+ $$invalidate('paused', paused);
}
function audio_progress_handler() {
buffered = timeRangesToArray(this.buffered);
- $$make_dirty('buffered');
+ $$invalidate('buffered', buffered);
}
function audio_loadedmetadata_handler() {
buffered = timeRangesToArray(this.buffered);
seekable = timeRangesToArray(this.seekable);
- $$make_dirty('buffered');
- $$make_dirty('seekable');
+ $$invalidate('buffered', buffered);
+ $$invalidate('seekable', seekable);
}
function audio_volumechange_handler() {
volume = this.volume;
- $$make_dirty('volume');
+ $$invalidate('volume', volume);
}
- $$self.$$.get = () => ({
+ $$self.$$.set = $$props => {
+ if ('buffered' in $$props) buffered = $$props.buffered;
+ if ('seekable' in $$props) seekable = $$props.seekable;
+ if ('played' in $$props) played = $$props.played;
+ if ('currentTime' in $$props) currentTime = $$props.currentTime;
+ if ('duration' in $$props) duration = $$props.duration;
+ if ('paused' in $$props) paused = $$props.paused;
+ if ('volume' in $$props) volume = $$props.volume;
+ };
+
+ return {
buffered,
seekable,
played,
@@ -107,85 +117,75 @@ function define($$self, $$props, $$make_dirty) {
audio_progress_handler,
audio_loadedmetadata_handler,
audio_volumechange_handler
- });
-
- $$self.$$.set = $$props => {
- if ('buffered' in $$props) buffered = $$props.buffered;
- if ('seekable' in $$props) seekable = $$props.seekable;
- if ('played' in $$props) played = $$props.played;
- if ('currentTime' in $$props) currentTime = $$props.currentTime;
- if ('duration' in $$props) duration = $$props.duration;
- if ('paused' in $$props) paused = $$props.paused;
- if ('volume' in $$props) volume = $$props.volume;
};
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get buffered() {
- return this.$$.get().buffered;
+ return this.$$.ctx.buffered;
}
- set buffered(value) {
- this.$set({ buffered: value });
+ set buffered(buffered) {
+ this.$set({ buffered });
flush();
}
get seekable() {
- return this.$$.get().seekable;
+ return this.$$.ctx.seekable;
}
- set seekable(value) {
- this.$set({ seekable: value });
+ set seekable(seekable) {
+ this.$set({ seekable });
flush();
}
get played() {
- return this.$$.get().played;
+ return this.$$.ctx.played;
}
- set played(value) {
- this.$set({ played: value });
+ set played(played) {
+ this.$set({ played });
flush();
}
get currentTime() {
- return this.$$.get().currentTime;
+ return this.$$.ctx.currentTime;
}
- set currentTime(value) {
- this.$set({ currentTime: value });
+ set currentTime(currentTime) {
+ this.$set({ currentTime });
flush();
}
get duration() {
- return this.$$.get().duration;
+ return this.$$.ctx.duration;
}
- set duration(value) {
- this.$set({ duration: value });
+ set duration(duration) {
+ this.$set({ duration });
flush();
}
get paused() {
- return this.$$.get().paused;
+ return this.$$.ctx.paused;
}
- set paused(value) {
- this.$set({ paused: value });
+ set paused(paused) {
+ this.$set({ paused });
flush();
}
get volume() {
- return this.$$.get().volume;
+ return this.$$.ctx.volume;
}
- set volume(value) {
- this.$set({ volume: value });
+ set volume(volume) {
+ this.$set({ volume });
flush();
}
}
diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js
index 2c2fa6a80e..6aafece192 100644
--- a/test/js/samples/non-imported-component/expected.js
+++ b/test/js/samples/non-imported-component/expected.js
@@ -55,7 +55,7 @@ function create_fragment(component, ctx) {
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, noop, create_fragment, safe_not_equal);
+ init(this, options, props => props, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/select-dynamic-value/expected.js b/test/js/samples/select-dynamic-value/expected.js
index 0533703f1c..c84f284223 100644
--- a/test/js/samples/select-dynamic-value/expected.js
+++ b/test/js/samples/select-dynamic-value/expected.js
@@ -63,28 +63,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { current } = $$props;
- $$self.$$.get = () => ({ current });
-
$$self.$$.set = $$props => {
if ('current' in $$props) current = $$props.current;
};
+
+ return { current };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get current() {
- return this.$$.get().current;
+ return this.$$.ctx.current;
}
- set current(value) {
- this.$set({ current: value });
+ set current(current) {
+ this.$set({ current });
flush();
}
}
diff --git a/test/js/samples/setup-method/expected.js b/test/js/samples/setup-method/expected.js
index e5c2b1b541..932001e400 100644
--- a/test/js/samples/setup-method/expected.js
+++ b/test/js/samples/setup-method/expected.js
@@ -23,7 +23,7 @@ function foo(bar) {
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, noop, create_fragment, safe_not_equal);
+ init(this, options, props => props, create_fragment, safe_not_equal);
}
get foo() {
diff --git a/test/js/samples/svg-title/expected.js b/test/js/samples/svg-title/expected.js
index 80b87f0fe7..cf80641637 100644
--- a/test/js/samples/svg-title/expected.js
+++ b/test/js/samples/svg-title/expected.js
@@ -38,7 +38,7 @@ function create_fragment(component, ctx) {
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, noop, create_fragment, safe_not_equal);
+ init(this, options, props => props, create_fragment, safe_not_equal);
}
}
diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js
index 69f412640a..107bbb9a40 100644
--- a/test/js/samples/title/expected.js
+++ b/test/js/samples/title/expected.js
@@ -22,28 +22,28 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { custom } = $$props;
- $$self.$$.get = () => ({ custom });
-
$$self.$$.set = $$props => {
if ('custom' in $$props) custom = $$props.custom;
};
+
+ return { custom };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get custom() {
- return this.$$.get().custom;
+ return this.$$.ctx.custom;
}
- set custom(value) {
- this.$set({ custom: value });
+ set custom(custom) {
+ this.$set({ custom });
flush();
}
}
diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js
index 8ef798cd67..742635f9c2 100644
--- a/test/js/samples/use-elements-as-anchors/expected.js
+++ b/test/js/samples/use-elements-as-anchors/expected.js
@@ -249,11 +249,9 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props) {
+function instance($$self, $$props) {
let { a, b, c, d, e } = $$props;
- $$self.$$.get = () => ({ a, b, c, d, e });
-
$$self.$$.set = $$props => {
if ('a' in $$props) a = $$props.a;
if ('b' in $$props) b = $$props.b;
@@ -261,56 +259,58 @@ function define($$self, $$props) {
if ('d' in $$props) d = $$props.d;
if ('e' in $$props) e = $$props.e;
};
+
+ return { a, b, c, d, e };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get a() {
- return this.$$.get().a;
+ return this.$$.ctx.a;
}
- set a(value) {
- this.$set({ a: value });
+ set a(a) {
+ this.$set({ a });
flush();
}
get b() {
- return this.$$.get().b;
+ return this.$$.ctx.b;
}
- set b(value) {
- this.$set({ b: value });
+ set b(b) {
+ this.$set({ b });
flush();
}
get c() {
- return this.$$.get().c;
+ return this.$$.ctx.c;
}
- set c(value) {
- this.$set({ c: value });
+ set c(c) {
+ this.$set({ c });
flush();
}
get d() {
- return this.$$.get().d;
+ return this.$$.ctx.d;
}
- set d(value) {
- this.$set({ d: value });
+ set d(d) {
+ this.$set({ d });
flush();
}
get e() {
- return this.$$.get().e;
+ return this.$$.ctx.e;
}
- set e(value) {
- this.$set({ e: value });
+ set e(e) {
+ this.$set({ e });
flush();
}
}
diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js
index 0600a211ee..0931e5a971 100644
--- a/test/js/samples/window-binding-scroll/expected.js
+++ b/test/js/samples/window-binding-scroll/expected.js
@@ -56,32 +56,32 @@ function create_fragment(component, ctx) {
};
}
-function define($$self, $$props, $$make_dirty) {
+function instance($$self, $$props, $$invalidate) {
let { y } = $$props;
function onwindowscroll() {
- y = window.pageYOffset; $$make_dirty('y');
+ y = window.pageYOffset; $$invalidate('y', y);
}
- $$self.$$.get = () => ({ y, onwindowscroll });
-
$$self.$$.set = $$props => {
if ('y' in $$props) y = $$props.y;
};
+
+ return { y, onwindowscroll };
}
class SvelteComponent extends SvelteComponent_1 {
constructor(options) {
super();
- init(this, options, define, create_fragment, safe_not_equal);
+ init(this, options, instance, create_fragment, safe_not_equal);
}
get y() {
- return this.$$.get().y;
+ return this.$$.ctx.y;
}
- set y(value) {
- this.$set({ y: value });
+ set y(y) {
+ this.$set({ y });
flush();
}
}