Skip to content

Commit

Permalink
add 'noop' param to some more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanhofer committed Nov 10, 2020
1 parent c0ac80f commit 7bd2ed6
Show file tree
Hide file tree
Showing 31 changed files with 80 additions and 69 deletions.
2 changes: 1 addition & 1 deletion test/js/samples/action/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function link(node) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
11 changes: 4 additions & 7 deletions test/js/samples/collapses-text-around-comments/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import {
SvelteComponent,
append,
appendStyleIfNotPresent,
attr,
detach,
element,
Expand All @@ -13,11 +14,8 @@ import {
text
} from "svelte/internal";

function add_css() {
var style = element("style");
style.id = "svelte-1a7i8ec-style";
style.textContent = "p.svelte-1a7i8ec{color:red}";
append(document.head, style);
function add_css(customStyleTag) {
appendStyleIfNotPresent(customStyleTag || document.head, "svelte-1a7i8ec-style", "p.svelte-1a7i8ec{color:red}");
}

function create_fragment(ctx) {
Expand Down Expand Up @@ -58,8 +56,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 }, noop);
init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 }, add_css);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/component-static-immutable/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function instance($$self) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, not_equal, {});
init(this, options, instance, create_fragment, not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/component-static-immutable2/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function instance($$self) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, not_equal, {});
init(this, options, instance, create_fragment, not_equal, {}, noop);
}
}

Expand Down
3 changes: 2 additions & 1 deletion test/js/samples/component-store-file-invalidate/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
SvelteComponent,
component_subscribe,
init,
noop,
safe_not_equal,
set_store_value
} from "svelte/internal";
Expand All @@ -23,7 +24,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, null, safe_not_equal, { increment: 0 });
init(this, options, instance, null, safe_not_equal, { increment: 0 }, noop);
}

get increment() {
Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/computed-collapsed-if/expected.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";

function instance($$self, $$props, $$invalidate) {
let { x } = $$props;
Expand All @@ -22,7 +22,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, null, safe_not_equal, { x: 0, a: 1, b: 2 });
init(this, options, instance, null, safe_not_equal, { x: 0, a: 1, b: 2 }, noop);
}

get a() {
Expand Down
12 changes: 4 additions & 8 deletions test/js/samples/css-media-query/expected.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
append,
appendStyleIfNotPresent,
attr,
detach,
element,
Expand All @@ -11,11 +11,8 @@ import {
safe_not_equal
} from "svelte/internal";

function add_css() {
var style = element("style");
style.id = "svelte-1slhpfn-style";
style.textContent = "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}";
append(document.head, style);
function add_css(customStyleTag) {
appendStyleIfNotPresent(customStyleTag || document.head, "svelte-1slhpfn-style", "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}");
}

function create_fragment(ctx) {
Expand All @@ -41,8 +38,7 @@ function create_fragment(ctx) {
class Component extends SvelteComponent {
constructor(options) {
super();
if (!document.getElementById("svelte-1slhpfn-style")) add_css();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, add_css);
}
}

Expand Down
3 changes: 2 additions & 1 deletion test/js/samples/css-shadow-dom-keyframes/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class Component extends SvelteElement {
null,
create_fragment,
safe_not_equal,
{}
{},
noop
);

if (options) {
Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/deconflict-globals/expected.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";

import { onMount } from "svelte";

Expand All @@ -20,7 +20,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, null, safe_not_equal, { foo: 0 });
init(this, options, instance, null, safe_not_equal, { foo: 0 }, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/dont-invalidate-this/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function make_uppercase() {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/dynamic-import/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const func = () => import("./Foo.svelte");
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/empty-dom/expected.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";

function instance($$self) {
const a = 1 + 2;
Expand All @@ -9,7 +9,7 @@ function instance($$self) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, null, safe_not_equal, {});
init(this, options, instance, null, safe_not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/event-handler-no-passive/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const touchstart_handler = e => e.preventDefault();
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
6 changes: 3 additions & 3 deletions test/js/samples/event-modifiers/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ function create_fragment(ctx) {
}

function handleTouchstart() {

} // ...

function handleClick() {

} // ...

class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/head-no-whitespace/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function create_fragment(ctx) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/hoisted-const/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function get_answer() {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/hoisted-let/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function get_answer() {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/hydrated-void-element/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function create_fragment(ctx) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/inline-style-unoptimized/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, { style: 0, key: 1, value: 2 });
init(this, options, instance, create_fragment, safe_not_equal, { style: 0, key: 1, value: 2 }, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/inline-style-without-updates/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let color = "red";
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/input-no-initial-value/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, {});
init(this, options, instance, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/legacy-input-type/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function create_fragment(ctx) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
34 changes: 21 additions & 13 deletions test/js/samples/media-bindings/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,19 +215,27 @@ class Component extends SvelteComponent {
constructor(options) {
super();

init(this, options, instance, create_fragment, safe_not_equal, {
buffered: 0,
seekable: 1,
played: 2,
currentTime: 3,
duration: 4,
paused: 5,
volume: 6,
muted: 7,
playbackRate: 8,
seeking: 9,
ended: 10
}, noop);
init(
this,
options,
instance,
create_fragment,
safe_not_equal,
{
buffered: 0,
seekable: 1,
played: 2,
currentTime: 3,
duration: 4,
paused: 5,
volume: 6,
muted: 7,
playbackRate: 8,
seeking: 9,
ended: 10
},
noop
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/non-imported-component/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function create_fragment(ctx) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/js/samples/non-mutable-reference/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let name = "world";
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, null, create_fragment, safe_not_equal, {});
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";

function instance($$self, $$props, $$invalidate) {
let { x } = $$props;
Expand All @@ -26,7 +26,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, null, safe_not_equal, { x: 0 });
init(this, options, instance, null, safe_not_equal, { x: 0 }, noop);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";

function instance($$self, $$props, $$invalidate) {
let { a = 1 } = $$props;
Expand All @@ -22,7 +22,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, null, safe_not_equal, { a: 0, b: 1 });
init(this, options, instance, null, safe_not_equal, { a: 0, b: 1 }, noop);
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/js/samples/setup-method/expected.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";

const SOME_CONSTANT = 42;

Expand All @@ -14,7 +14,7 @@ function instance($$self, $$props, $$invalidate) {
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, null, safe_not_equal, { foo: 0 });
init(this, options, instance, null, safe_not_equal, { foo: 0 }, noop);
}

get foo() {
Expand Down
Loading

0 comments on commit 7bd2ed6

Please sign in to comment.