From 675d6ddd100e51890587e0a7972de0e668e5fb4e Mon Sep 17 00:00:00 2001 From: Ivan Hofer Date: Thu, 12 Nov 2020 07:07:42 +0100 Subject: [PATCH] Revert "add 'noop' param to some more tests" This reverts commit 7bd2ed6096e51167ae094611f5287584075d62a4. --- test/js/samples/action/expected.js | 2 +- .../expected.js | 11 +++--- .../component-static-immutable/expected.js | 2 +- .../component-static-immutable2/expected.js | 2 +- .../expected.js | 3 +- .../samples/computed-collapsed-if/expected.js | 4 +-- test/js/samples/css-media-query/expected.js | 12 ++++--- .../css-shadow-dom-keyframes/expected.js | 3 +- .../js/samples/deconflict-globals/expected.js | 4 +-- .../samples/dont-invalidate-this/expected.js | 2 +- test/js/samples/dynamic-import/expected.js | 2 +- test/js/samples/empty-dom/expected.js | 4 +-- .../event-handler-no-passive/expected.js | 2 +- test/js/samples/event-modifiers/expected.js | 6 ++-- .../js/samples/head-no-whitespace/expected.js | 2 +- test/js/samples/hoisted-const/expected.js | 2 +- test/js/samples/hoisted-let/expected.js | 2 +- .../samples/hydrated-void-element/expected.js | 2 +- .../inline-style-unoptimized/expected.js | 2 +- .../inline-style-without-updates/expected.js | 2 +- .../input-no-initial-value/expected.js | 2 +- test/js/samples/legacy-input-type/expected.js | 2 +- test/js/samples/media-bindings/expected.js | 34 +++++++------------ .../non-imported-component/expected.js | 2 +- .../samples/non-mutable-reference/expected.js | 2 +- .../expected.js | 4 +-- .../expected.js | 4 +-- test/js/samples/setup-method/expected.js | 4 +-- test/js/samples/svg-title/expected.js | 2 +- .../expected.js | 2 +- test/js/samples/video-bindings/expected.js | 20 ++++------- 31 files changed, 69 insertions(+), 80 deletions(-) diff --git a/test/js/samples/action/expected.js b/test/js/samples/action/expected.js index 767a4574b8..d52960bddd 100644 --- a/test/js/samples/action/expected.js +++ b/test/js/samples/action/expected.js @@ -60,7 +60,7 @@ function link(node) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index b32c38dd02..41a574eba5 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -2,7 +2,6 @@ import { SvelteComponent, append, - appendStyleIfNotPresent, attr, detach, element, @@ -14,8 +13,11 @@ import { text } from "svelte/internal"; -function add_css(customStyleTag) { - appendStyleIfNotPresent(customStyleTag || document.head, "svelte-1a7i8ec-style", "p.svelte-1a7i8ec{color:red}"); +function add_css() { + var style = element("style"); + style.id = "svelte-1a7i8ec-style"; + style.textContent = "p.svelte-1a7i8ec{color:red}"; + append(document.head, style); } function create_fragment(ctx) { @@ -56,7 +58,8 @@ function instance($$self, $$props, $$invalidate) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 }, add_css); + if (!document.getElementById("svelte-1a7i8ec-style")) add_css(); + init(this, options, instance, create_fragment, safe_not_equal, { foo: 0 }, noop); } } diff --git a/test/js/samples/component-static-immutable/expected.js b/test/js/samples/component-static-immutable/expected.js index 7de4e04bb9..b0c4165413 100644 --- a/test/js/samples/component-static-immutable/expected.js +++ b/test/js/samples/component-static-immutable/expected.js @@ -48,7 +48,7 @@ function instance($$self) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, instance, create_fragment, not_equal, {}, noop); + 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 7de4e04bb9..b0c4165413 100644 --- a/test/js/samples/component-static-immutable2/expected.js +++ b/test/js/samples/component-static-immutable2/expected.js @@ -48,7 +48,7 @@ function instance($$self) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, instance, create_fragment, not_equal, {}, noop); + init(this, options, instance, create_fragment, not_equal, {}); } } diff --git a/test/js/samples/component-store-file-invalidate/expected.js b/test/js/samples/component-store-file-invalidate/expected.js index 27cfd9a56a..d2fb3d0be4 100644 --- a/test/js/samples/component-store-file-invalidate/expected.js +++ b/test/js/samples/component-store-file-invalidate/expected.js @@ -3,7 +3,6 @@ import { SvelteComponent, component_subscribe, init, - noop, safe_not_equal, set_store_value } from "svelte/internal"; @@ -24,7 +23,7 @@ function instance($$self, $$props, $$invalidate) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, instance, null, safe_not_equal, { increment: 0 }, noop); + init(this, options, instance, null, safe_not_equal, { increment: 0 }); } get increment() { diff --git a/test/js/samples/computed-collapsed-if/expected.js b/test/js/samples/computed-collapsed-if/expected.js index aea9578652..3e70d6a7ae 100644 --- a/test/js/samples/computed-collapsed-if/expected.js +++ b/test/js/samples/computed-collapsed-if/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal"; +import { SvelteComponent, init, safe_not_equal } from "svelte/internal"; function instance($$self, $$props, $$invalidate) { let { x } = $$props; @@ -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 }, noop); + init(this, options, instance, null, safe_not_equal, { x: 0, a: 1, b: 2 }); } get a() { diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index 007636ce09..f477670059 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -1,7 +1,7 @@ /* generated by Svelte vX.Y.Z */ import { SvelteComponent, - appendStyleIfNotPresent, + append, attr, detach, element, @@ -11,8 +11,11 @@ import { safe_not_equal } from "svelte/internal"; -function add_css(customStyleTag) { - appendStyleIfNotPresent(customStyleTag || document.head, "svelte-1slhpfn-style", "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}"); +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 create_fragment(ctx) { @@ -38,7 +41,8 @@ function create_fragment(ctx) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, add_css); + if (!document.getElementById("svelte-1slhpfn-style")) add_css(); + init(this, options, null, 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 5f87f4a0a8..82a39e5924 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -45,8 +45,7 @@ class Component extends SvelteElement { null, create_fragment, safe_not_equal, - {}, - noop + {} ); if (options) { diff --git a/test/js/samples/deconflict-globals/expected.js b/test/js/samples/deconflict-globals/expected.js index 290f8e6509..7168eba6a5 100644 --- a/test/js/samples/deconflict-globals/expected.js +++ b/test/js/samples/deconflict-globals/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal"; +import { SvelteComponent, init, safe_not_equal } from "svelte/internal"; import { onMount } from "svelte"; @@ -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 }, noop); + init(this, options, instance, null, safe_not_equal, { foo: 0 }); } } diff --git a/test/js/samples/dont-invalidate-this/expected.js b/test/js/samples/dont-invalidate-this/expected.js index 33d86f4148..0b155373a1 100644 --- a/test/js/samples/dont-invalidate-this/expected.js +++ b/test/js/samples/dont-invalidate-this/expected.js @@ -45,7 +45,7 @@ function make_uppercase() { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/dynamic-import/expected.js b/test/js/samples/dynamic-import/expected.js index 559ad9217c..d1085f431b 100644 --- a/test/js/samples/dynamic-import/expected.js +++ b/test/js/samples/dynamic-import/expected.js @@ -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, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/empty-dom/expected.js b/test/js/samples/empty-dom/expected.js index b3e57758c1..d5c80be696 100644 --- a/test/js/samples/empty-dom/expected.js +++ b/test/js/samples/empty-dom/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal"; +import { SvelteComponent, init, safe_not_equal } from "svelte/internal"; function instance($$self) { const a = 1 + 2; @@ -9,7 +9,7 @@ function instance($$self) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, instance, null, safe_not_equal, {}, noop); + init(this, options, instance, null, safe_not_equal, {}); } } diff --git a/test/js/samples/event-handler-no-passive/expected.js b/test/js/samples/event-handler-no-passive/expected.js index de4b3225a2..4d4b910d4e 100644 --- a/test/js/samples/event-handler-no-passive/expected.js +++ b/test/js/samples/event-handler-no-passive/expected.js @@ -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, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/event-modifiers/expected.js b/test/js/samples/event-modifiers/expected.js index b444d4cba1..3901753661 100644 --- a/test/js/samples/event-modifiers/expected.js +++ b/test/js/samples/event-modifiers/expected.js @@ -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, {}, noop); + init(this, options, null, 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 cf7104c744..444bad3fd4 100644 --- a/test/js/samples/head-no-whitespace/expected.js +++ b/test/js/samples/head-no-whitespace/expected.js @@ -40,7 +40,7 @@ function create_fragment(ctx) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/hoisted-const/expected.js b/test/js/samples/hoisted-const/expected.js index af72500ea9..2842b54751 100644 --- a/test/js/samples/hoisted-const/expected.js +++ b/test/js/samples/hoisted-const/expected.js @@ -38,7 +38,7 @@ function get_answer() { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/hoisted-let/expected.js b/test/js/samples/hoisted-let/expected.js index d5401f2f21..285b124118 100644 --- a/test/js/samples/hoisted-let/expected.js +++ b/test/js/samples/hoisted-let/expected.js @@ -38,7 +38,7 @@ function get_answer() { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/hydrated-void-element/expected.js b/test/js/samples/hydrated-void-element/expected.js index b7e9990d1e..e53d16d925 100644 --- a/test/js/samples/hydrated-void-element/expected.js +++ b/test/js/samples/hydrated-void-element/expected.js @@ -57,7 +57,7 @@ function create_fragment(ctx) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index fac15c691a..0688f14b9b 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -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 }, noop); + init(this, options, instance, create_fragment, safe_not_equal, { style: 0, key: 1, value: 2 }); } } diff --git a/test/js/samples/inline-style-without-updates/expected.js b/test/js/samples/inline-style-without-updates/expected.js index 8a3768a048..375896f259 100644 --- a/test/js/samples/inline-style-without-updates/expected.js +++ b/test/js/samples/inline-style-without-updates/expected.js @@ -35,7 +35,7 @@ let color = "red"; class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/input-no-initial-value/expected.js b/test/js/samples/input-no-initial-value/expected.js index 8ece8f5ce2..3354aa3111 100644 --- a/test/js/samples/input-no-initial-value/expected.js +++ b/test/js/samples/input-no-initial-value/expected.js @@ -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, {}, noop); + 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 6f07bbc8d5..2b76a48522 100644 --- a/test/js/samples/legacy-input-type/expected.js +++ b/test/js/samples/legacy-input-type/expected.js @@ -33,7 +33,7 @@ function create_fragment(ctx) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index 78f248588c..9ee63938fa 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -215,27 +215,19 @@ 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); } } diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js index 5c77f9d9f4..5a6b8e8bb7 100644 --- a/test/js/samples/non-imported-component/expected.js +++ b/test/js/samples/non-imported-component/expected.js @@ -59,7 +59,7 @@ function create_fragment(ctx) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/non-mutable-reference/expected.js b/test/js/samples/non-mutable-reference/expected.js index 46b175dcb0..93f2145a2e 100644 --- a/test/js/samples/non-mutable-reference/expected.js +++ b/test/js/samples/non-mutable-reference/expected.js @@ -34,7 +34,7 @@ let name = "world"; class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } 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 29ca096fdd..15290496d5 100644 --- a/test/js/samples/reactive-values-non-topologically-ordered/expected.js +++ b/test/js/samples/reactive-values-non-topologically-ordered/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal"; +import { SvelteComponent, init, safe_not_equal } from "svelte/internal"; function instance($$self, $$props, $$invalidate) { let { x } = $$props; @@ -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 }, noop); + init(this, options, instance, null, safe_not_equal, { x: 0 }); } } 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 82e4309827..5196a770d9 100644 --- a/test/js/samples/reactive-values-non-writable-dependencies/expected.js +++ b/test/js/samples/reactive-values-non-writable-dependencies/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal"; +import { SvelteComponent, init, safe_not_equal } from "svelte/internal"; function instance($$self, $$props, $$invalidate) { let { a = 1 } = $$props; @@ -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 }, noop); + init(this, options, instance, null, safe_not_equal, { a: 0, b: 1 }); } } diff --git a/test/js/samples/setup-method/expected.js b/test/js/samples/setup-method/expected.js index a5d2f046aa..8e30a03a7d 100644 --- a/test/js/samples/setup-method/expected.js +++ b/test/js/samples/setup-method/expected.js @@ -1,5 +1,5 @@ /* generated by Svelte vX.Y.Z */ -import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal"; +import { SvelteComponent, init, safe_not_equal } from "svelte/internal"; const SOME_CONSTANT = 42; @@ -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 }, noop); + init(this, options, instance, null, safe_not_equal, { foo: 0 }); } get foo() { diff --git a/test/js/samples/svg-title/expected.js b/test/js/samples/svg-title/expected.js index aacef416e2..cd7ae3b551 100644 --- a/test/js/samples/svg-title/expected.js +++ b/test/js/samples/svg-title/expected.js @@ -39,7 +39,7 @@ function create_fragment(ctx) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/valid-inner-html-for-static-element/expected.js b/test/js/samples/valid-inner-html-for-static-element/expected.js index 241e083b61..f1ced27ba4 100644 --- a/test/js/samples/valid-inner-html-for-static-element/expected.js +++ b/test/js/samples/valid-inner-html-for-static-element/expected.js @@ -32,7 +32,7 @@ function create_fragment(ctx) { class Component extends SvelteComponent { constructor(options) { super(); - init(this, options, null, create_fragment, safe_not_equal, {}, noop); + init(this, options, null, create_fragment, safe_not_equal, {}); } } diff --git a/test/js/samples/video-bindings/expected.js b/test/js/samples/video-bindings/expected.js index 5199c7fa83..09f3b4a75f 100644 --- a/test/js/samples/video-bindings/expected.js +++ b/test/js/samples/video-bindings/expected.js @@ -115,20 +115,12 @@ class Component extends SvelteComponent { constructor(options) { super(); - init( - this, - options, - instance, - create_fragment, - safe_not_equal, - { - currentTime: 0, - videoHeight: 1, - videoWidth: 2, - offsetWidth: 3 - }, - noop - ); + init(this, options, instance, create_fragment, safe_not_equal, { + currentTime: 0, + videoHeight: 1, + videoWidth: 2, + offsetWidth: 3 + }, noop); } }