Skip to content

Commit 7bd2ed6

Browse files
committed
add 'noop' param to some more tests
1 parent c0ac80f commit 7bd2ed6

File tree

31 files changed

+80
-69
lines changed

31 files changed

+80
-69
lines changed

test/js/samples/action/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function link(node) {
6060
class Component extends SvelteComponent {
6161
constructor(options) {
6262
super();
63-
init(this, options, null, create_fragment, safe_not_equal, {});
63+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
6464
}
6565
}
6666

test/js/samples/collapses-text-around-comments/expected.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import {
33
SvelteComponent,
44
append,
5+
appendStyleIfNotPresent,
56
attr,
67
detach,
78
element,
@@ -13,11 +14,8 @@ import {
1314
text
1415
} from "svelte/internal";
1516

16-
function add_css() {
17-
var style = element("style");
18-
style.id = "svelte-1a7i8ec-style";
19-
style.textContent = "p.svelte-1a7i8ec{color:red}";
20-
append(document.head, style);
17+
function add_css(customStyleTag) {
18+
appendStyleIfNotPresent(customStyleTag || document.head, "svelte-1a7i8ec-style", "p.svelte-1a7i8ec{color:red}");
2119
}
2220

2321
function create_fragment(ctx) {
@@ -58,8 +56,7 @@ function instance($$self, $$props, $$invalidate) {
5856
class Component extends SvelteComponent {
5957
constructor(options) {
6058
super();
61-
if (!document.getElementById("svelte-1a7i8ec-style")) add_css();
62-
init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 }, noop);
59+
init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 }, add_css);
6360
}
6461
}
6562

test/js/samples/component-static-immutable/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function instance($$self) {
4848
class Component extends SvelteComponent {
4949
constructor(options) {
5050
super();
51-
init(this, options, instance, create_fragment, not_equal, {});
51+
init(this, options, instance, create_fragment, not_equal, {}, noop);
5252
}
5353
}
5454

test/js/samples/component-static-immutable2/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function instance($$self) {
4848
class Component extends SvelteComponent {
4949
constructor(options) {
5050
super();
51-
init(this, options, instance, create_fragment, not_equal, {});
51+
init(this, options, instance, create_fragment, not_equal, {}, noop);
5252
}
5353
}
5454

test/js/samples/component-store-file-invalidate/expected.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
SvelteComponent,
44
component_subscribe,
55
init,
6+
noop,
67
safe_not_equal,
78
set_store_value
89
} from "svelte/internal";
@@ -23,7 +24,7 @@ function instance($$self, $$props, $$invalidate) {
2324
class Component extends SvelteComponent {
2425
constructor(options) {
2526
super();
26-
init(this, options, instance, null, safe_not_equal, { increment: 0 });
27+
init(this, options, instance, null, safe_not_equal, { increment: 0 }, noop);
2728
}
2829

2930
get increment() {

test/js/samples/computed-collapsed-if/expected.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* generated by Svelte vX.Y.Z */
2-
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
2+
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";
33

44
function instance($$self, $$props, $$invalidate) {
55
let { x } = $$props;
@@ -22,7 +22,7 @@ function instance($$self, $$props, $$invalidate) {
2222
class Component extends SvelteComponent {
2323
constructor(options) {
2424
super();
25-
init(this, options, instance, null, safe_not_equal, { x: 0, a: 1, b: 2 });
25+
init(this, options, instance, null, safe_not_equal, { x: 0, a: 1, b: 2 }, noop);
2626
}
2727

2828
get a() {

test/js/samples/css-media-query/expected.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* generated by Svelte vX.Y.Z */
22
import {
33
SvelteComponent,
4-
append,
4+
appendStyleIfNotPresent,
55
attr,
66
detach,
77
element,
@@ -11,11 +11,8 @@ import {
1111
safe_not_equal
1212
} from "svelte/internal";
1313

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

2118
function create_fragment(ctx) {
@@ -41,8 +38,7 @@ function create_fragment(ctx) {
4138
class Component extends SvelteComponent {
4239
constructor(options) {
4340
super();
44-
if (!document.getElementById("svelte-1slhpfn-style")) add_css();
45-
init(this, options, null, create_fragment, safe_not_equal, {});
41+
init(this, options, null, create_fragment, safe_not_equal, {}, add_css);
4642
}
4743
}
4844

test/js/samples/css-shadow-dom-keyframes/expected.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ class Component extends SvelteElement {
4545
null,
4646
create_fragment,
4747
safe_not_equal,
48-
{}
48+
{},
49+
noop
4950
);
5051

5152
if (options) {

test/js/samples/deconflict-globals/expected.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* generated by Svelte vX.Y.Z */
2-
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
2+
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";
33

44
import { onMount } from "svelte";
55

@@ -20,7 +20,7 @@ function instance($$self, $$props, $$invalidate) {
2020
class Component extends SvelteComponent {
2121
constructor(options) {
2222
super();
23-
init(this, options, instance, null, safe_not_equal, { foo: 0 });
23+
init(this, options, instance, null, safe_not_equal, { foo: 0 }, noop);
2424
}
2525
}
2626

test/js/samples/dont-invalidate-this/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function make_uppercase() {
4545
class Component extends SvelteComponent {
4646
constructor(options) {
4747
super();
48-
init(this, options, null, create_fragment, safe_not_equal, {});
48+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
4949
}
5050
}
5151

test/js/samples/dynamic-import/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const func = () => import("./Foo.svelte");
4747
class Component extends SvelteComponent {
4848
constructor(options) {
4949
super();
50-
init(this, options, null, create_fragment, safe_not_equal, {});
50+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
5151
}
5252
}
5353

test/js/samples/empty-dom/expected.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* generated by Svelte vX.Y.Z */
2-
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
2+
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";
33

44
function instance($$self) {
55
const a = 1 + 2;
@@ -9,7 +9,7 @@ function instance($$self) {
99
class Component extends SvelteComponent {
1010
constructor(options) {
1111
super();
12-
init(this, options, instance, null, safe_not_equal, {});
12+
init(this, options, instance, null, safe_not_equal, {}, noop);
1313
}
1414
}
1515

test/js/samples/event-handler-no-passive/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const touchstart_handler = e => e.preventDefault();
4646
class Component extends SvelteComponent {
4747
constructor(options) {
4848
super();
49-
init(this, options, null, create_fragment, safe_not_equal, {});
49+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
5050
}
5151
}
5252

test/js/samples/event-modifiers/expected.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ function create_fragment(ctx) {
7676
}
7777

7878
function handleTouchstart() {
79-
79+
8080
} // ...
8181

8282
function handleClick() {
83-
83+
8484
} // ...
8585

8686
class Component extends SvelteComponent {
8787
constructor(options) {
8888
super();
89-
init(this, options, null, create_fragment, safe_not_equal, {});
89+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
9090
}
9191
}
9292

test/js/samples/head-no-whitespace/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function create_fragment(ctx) {
4040
class Component extends SvelteComponent {
4141
constructor(options) {
4242
super();
43-
init(this, options, null, create_fragment, safe_not_equal, {});
43+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
4444
}
4545
}
4646

test/js/samples/hoisted-const/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function get_answer() {
3838
class Component extends SvelteComponent {
3939
constructor(options) {
4040
super();
41-
init(this, options, null, create_fragment, safe_not_equal, {});
41+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
4242
}
4343
}
4444

test/js/samples/hoisted-let/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function get_answer() {
3838
class Component extends SvelteComponent {
3939
constructor(options) {
4040
super();
41-
init(this, options, null, create_fragment, safe_not_equal, {});
41+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
4242
}
4343
}
4444

test/js/samples/hydrated-void-element/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function create_fragment(ctx) {
5757
class Component extends SvelteComponent {
5858
constructor(options) {
5959
super();
60-
init(this, options, null, create_fragment, safe_not_equal, {});
60+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
6161
}
6262
}
6363

test/js/samples/inline-style-unoptimized/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function instance($$self, $$props, $$invalidate) {
6666
class Component extends SvelteComponent {
6767
constructor(options) {
6868
super();
69-
init(this, options, instance, create_fragment, safe_not_equal, { style: 0, key: 1, value: 2 });
69+
init(this, options, instance, create_fragment, safe_not_equal, { style: 0, key: 1, value: 2 }, noop);
7070
}
7171
}
7272

test/js/samples/inline-style-without-updates/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let color = "red";
3535
class Component extends SvelteComponent {
3636
constructor(options) {
3737
super();
38-
init(this, options, null, create_fragment, safe_not_equal, {});
38+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
3939
}
4040
}
4141

test/js/samples/input-no-initial-value/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function instance($$self, $$props, $$invalidate) {
8383
class Component extends SvelteComponent {
8484
constructor(options) {
8585
super();
86-
init(this, options, instance, create_fragment, safe_not_equal, {});
86+
init(this, options, instance, create_fragment, safe_not_equal, {}, noop);
8787
}
8888
}
8989

test/js/samples/legacy-input-type/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function create_fragment(ctx) {
3333
class Component extends SvelteComponent {
3434
constructor(options) {
3535
super();
36-
init(this, options, null, create_fragment, safe_not_equal, {});
36+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
3737
}
3838
}
3939

test/js/samples/media-bindings/expected.js

+21-13
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,27 @@ class Component extends SvelteComponent {
215215
constructor(options) {
216216
super();
217217

218-
init(this, options, instance, create_fragment, safe_not_equal, {
219-
buffered: 0,
220-
seekable: 1,
221-
played: 2,
222-
currentTime: 3,
223-
duration: 4,
224-
paused: 5,
225-
volume: 6,
226-
muted: 7,
227-
playbackRate: 8,
228-
seeking: 9,
229-
ended: 10
230-
}, noop);
218+
init(
219+
this,
220+
options,
221+
instance,
222+
create_fragment,
223+
safe_not_equal,
224+
{
225+
buffered: 0,
226+
seekable: 1,
227+
played: 2,
228+
currentTime: 3,
229+
duration: 4,
230+
paused: 5,
231+
volume: 6,
232+
muted: 7,
233+
playbackRate: 8,
234+
seeking: 9,
235+
ended: 10
236+
},
237+
noop
238+
);
231239
}
232240
}
233241

test/js/samples/non-imported-component/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function create_fragment(ctx) {
5959
class Component extends SvelteComponent {
6060
constructor(options) {
6161
super();
62-
init(this, options, null, create_fragment, safe_not_equal, {});
62+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
6363
}
6464
}
6565

test/js/samples/non-mutable-reference/expected.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ let name = "world";
3434
class Component extends SvelteComponent {
3535
constructor(options) {
3636
super();
37-
init(this, options, null, create_fragment, safe_not_equal, {});
37+
init(this, options, null, create_fragment, safe_not_equal, {}, noop);
3838
}
3939
}
4040

test/js/samples/reactive-values-non-topologically-ordered/expected.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* generated by Svelte vX.Y.Z */
2-
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
2+
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";
33

44
function instance($$self, $$props, $$invalidate) {
55
let { x } = $$props;
@@ -26,7 +26,7 @@ function instance($$self, $$props, $$invalidate) {
2626
class Component extends SvelteComponent {
2727
constructor(options) {
2828
super();
29-
init(this, options, instance, null, safe_not_equal, { x: 0 });
29+
init(this, options, instance, null, safe_not_equal, { x: 0 }, noop);
3030
}
3131
}
3232

test/js/samples/reactive-values-non-writable-dependencies/expected.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* generated by Svelte vX.Y.Z */
2-
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
2+
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";
33

44
function instance($$self, $$props, $$invalidate) {
55
let { a = 1 } = $$props;
@@ -22,7 +22,7 @@ function instance($$self, $$props, $$invalidate) {
2222
class Component extends SvelteComponent {
2323
constructor(options) {
2424
super();
25-
init(this, options, instance, null, safe_not_equal, { a: 0, b: 1 });
25+
init(this, options, instance, null, safe_not_equal, { a: 0, b: 1 }, noop);
2626
}
2727
}
2828

test/js/samples/setup-method/expected.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* generated by Svelte vX.Y.Z */
2-
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
2+
import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal";
33

44
const SOME_CONSTANT = 42;
55

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

2020
get foo() {

0 commit comments

Comments
 (0)