diff --git a/src/compiler/compile/render_dom/index.ts b/src/compiler/compile/render_dom/index.ts index d79af2ea75..e749af6729 100644 --- a/src/compiler/compile/render_dom/index.ts +++ b/src/compiler/compile/render_dom/index.ts @@ -288,7 +288,7 @@ export default function dom( const has_create_fragment = component.compile_options.dev || block.has_content(); if (has_create_fragment) { body.push(b` - function create_fragment(root, #ctx) { + function create_fragment(#ctx) { ${block.get_contents()} } `); diff --git a/src/compiler/compile/render_dom/wrappers/EachBlock.ts b/src/compiler/compile/render_dom/wrappers/EachBlock.ts index 134976ca65..81ebb54dbe 100644 --- a/src/compiler/compile/render_dom/wrappers/EachBlock.ts +++ b/src/compiler/compile/render_dom/wrappers/EachBlock.ts @@ -355,6 +355,7 @@ export default class EachBlockWrapper extends Wrapper { function ${this.vars.get_each_context}(#ctx, list, i) { const child_ctx = #ctx.slice(); ${this.context_props} + child_ctx.root = #ctx.root; return child_ctx; } `); diff --git a/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts b/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts index ad85883d2b..1e9818c78b 100644 --- a/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts +++ b/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts @@ -191,7 +191,7 @@ export default class InlineComponentWrapper extends Wrapper { // will complain that options.target is missing. This would // work better if components had separate public and private // APIs - component_opts.properties.push(p`root`); + component_opts.properties.push(p`root: #ctx.root`); component_opts.properties.push(p`$$inline: true`); } diff --git a/src/runtime/internal/Component.ts b/src/runtime/internal/Component.ts index f58d0971d8..55f6e649a6 100644 --- a/src/runtime/internal/Component.ts +++ b/src/runtime/internal/Component.ts @@ -144,12 +144,14 @@ export function init(component, options, instance, create_fragment, not_equal, p }) : []; + $$.ctx.root = options.target || options.root; + $$.update(); ready = true; run_all($$.before_update); // `false` as a special case of no DOM component - $$.fragment = create_fragment ? create_fragment(options.target || options.root, $$.ctx) : false; + $$.fragment = create_fragment ? create_fragment($$.ctx) : false; if (options.target) { if (options.hydrate) { diff --git a/src/runtime/internal/await_block.ts b/src/runtime/internal/await_block.ts index ea6e8a187f..53ceaeb38a 100644 --- a/src/runtime/internal/await_block.ts +++ b/src/runtime/internal/await_block.ts @@ -16,6 +16,7 @@ export function handle_promise(promise, info) { if (key !== undefined) { child_ctx = child_ctx.slice(); child_ctx[key] = value; + child_ctx.root = info.ctx.root; } const block = type && (info.current = type)(child_ctx); diff --git a/src/runtime/internal/utils.ts b/src/runtime/internal/utils.ts index 9f3da8589a..d0254c93ef 100644 --- a/src/runtime/internal/utils.ts +++ b/src/runtime/internal/utils.ts @@ -79,10 +79,12 @@ export function create_slot(definition, ctx, $$scope, fn) { } } -export function get_slot_context(definition, ctx, $$scope, fn) { - return definition[1] && fn +function get_slot_context(definition, ctx, $$scope, fn) { + const context = definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx; + context.root = ctx.root; + return context; } export function get_slot_changes(definition, $$scope, dirty, fn) { diff --git a/test/js/samples/action-custom-event-handler/expected.js b/test/js/samples/action-custom-event-handler/expected.js index d777cffd00..5ae9594ce0 100644 --- a/test/js/samples/action-custom-event-handler/expected.js +++ b/test/js/samples/action-custom-event-handler/expected.js @@ -11,7 +11,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let button; let foo_action; let mounted; diff --git a/test/js/samples/action/expected.js b/test/js/samples/action/expected.js index d563784332..d52960bddd 100644 --- a/test/js/samples/action/expected.js +++ b/test/js/samples/action/expected.js @@ -11,7 +11,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let a; let link_action; let mounted; diff --git a/test/js/samples/bind-online/expected.js b/test/js/samples/bind-online/expected.js index 0d064399b4..887195bce1 100644 --- a/test/js/samples/bind-online/expected.js +++ b/test/js/samples/bind-online/expected.js @@ -9,7 +9,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let mounted; let dispose; add_render_callback(/*onlinestatuschanged*/ ctx[1]); diff --git a/test/js/samples/bind-open/expected.js b/test/js/samples/bind-open/expected.js index cb7dc2c888..56ff302845 100644 --- a/test/js/samples/bind-open/expected.js +++ b/test/js/samples/bind-open/expected.js @@ -10,7 +10,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let details; let mounted; let dispose; diff --git a/test/js/samples/bind-width-height/expected.js b/test/js/samples/bind-width-height/expected.js index 76a49fb5ce..f23c20b683 100644 --- a/test/js/samples/bind-width-height/expected.js +++ b/test/js/samples/bind-width-height/expected.js @@ -11,7 +11,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div; let div_resize_listener; diff --git a/test/js/samples/bindings-readonly-order/expected.js b/test/js/samples/bindings-readonly-order/expected.js index 630210368b..78a71dcd84 100644 --- a/test/js/samples/bindings-readonly-order/expected.js +++ b/test/js/samples/bindings-readonly-order/expected.js @@ -13,7 +13,7 @@ import { space } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let input0; let t; let input1; diff --git a/test/js/samples/capture-inject-dev-only/expected.js b/test/js/samples/capture-inject-dev-only/expected.js index 18e9d97016..a87693dd9e 100644 --- a/test/js/samples/capture-inject-dev-only/expected.js +++ b/test/js/samples/capture-inject-dev-only/expected.js @@ -15,7 +15,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let p; let t0; let t1; diff --git a/test/js/samples/capture-inject-state/expected.js b/test/js/samples/capture-inject-state/expected.js index 0bfa2a4db4..6485526bd4 100644 --- a/test/js/samples/capture-inject-state/expected.js +++ b/test/js/samples/capture-inject-state/expected.js @@ -20,7 +20,7 @@ import { const file = undefined; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let p; let t0; let t1; diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index e50442771b..e3e000094f 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -18,7 +18,7 @@ function add_css(options) { append_styles(options, "1a7i8ec", "p.svelte-1a7i8ec{color:red}"); } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let p; let t; diff --git a/test/js/samples/component-static-array/expected.js b/test/js/samples/component-static-array/expected.js index dfac6acde3..0ecb0f32ba 100644 --- a/test/js/samples/component-static-array/expected.js +++ b/test/js/samples/component-static-array/expected.js @@ -11,7 +11,7 @@ import { transition_out } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let nested; let current; nested = new /*Nested*/ ctx[0]({ props: { foo: [1, 2, 3] } }); diff --git a/test/js/samples/component-static-immutable/expected.js b/test/js/samples/component-static-immutable/expected.js index 594c063b85..b0c4165413 100644 --- a/test/js/samples/component-static-immutable/expected.js +++ b/test/js/samples/component-static-immutable/expected.js @@ -11,7 +11,7 @@ import { transition_out } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let nested; let current; nested = new /*Nested*/ ctx[0]({ props: { foo: "bar" } }); diff --git a/test/js/samples/component-static-immutable2/expected.js b/test/js/samples/component-static-immutable2/expected.js index 594c063b85..b0c4165413 100644 --- a/test/js/samples/component-static-immutable2/expected.js +++ b/test/js/samples/component-static-immutable2/expected.js @@ -11,7 +11,7 @@ import { transition_out } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let nested; let current; nested = new /*Nested*/ ctx[0]({ props: { foo: "bar" } }); diff --git a/test/js/samples/component-static-var/expected.js b/test/js/samples/component-static-var/expected.js index 9cef35aa3b..2cd5ed386f 100644 --- a/test/js/samples/component-static-var/expected.js +++ b/test/js/samples/component-static-var/expected.js @@ -19,7 +19,7 @@ import { import Foo from "./Foo.svelte"; import Bar from "./Bar.svelte"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let foo; let t0; let bar; diff --git a/test/js/samples/component-static/expected.js b/test/js/samples/component-static/expected.js index 2876b5a9d1..186f6350e6 100644 --- a/test/js/samples/component-static/expected.js +++ b/test/js/samples/component-static/expected.js @@ -11,7 +11,7 @@ import { transition_out } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let nested; let current; nested = new /*Nested*/ ctx[0]({ props: { foo: "bar" } }); diff --git a/test/js/samples/component-store-access-invalidate/expected.js b/test/js/samples/component-store-access-invalidate/expected.js index e9437067f3..4c7bfd7009 100644 --- a/test/js/samples/component-store-access-invalidate/expected.js +++ b/test/js/samples/component-store-access-invalidate/expected.js @@ -15,7 +15,7 @@ import { import { writable } from "svelte/store"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let h1; let t; diff --git a/test/js/samples/component-store-reassign-invalidate/expected.js b/test/js/samples/component-store-reassign-invalidate/expected.js index 224ff613ac..0cf555bf0d 100644 --- a/test/js/samples/component-store-reassign-invalidate/expected.js +++ b/test/js/samples/component-store-reassign-invalidate/expected.js @@ -17,7 +17,7 @@ import { import { writable } from "svelte/store"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let h1; let t0; let t1; diff --git a/test/js/samples/css-media-query/expected.js b/test/js/samples/css-media-query/expected.js index d3dfaca9c3..749c692aa1 100644 --- a/test/js/samples/css-media-query/expected.js +++ b/test/js/samples/css-media-query/expected.js @@ -15,7 +15,7 @@ function add_css(options) { append_styles(options, "1slhpfn", "@media(min-width: 1px){div.svelte-1slhpfn{color:red}}"); } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div; return { diff --git a/test/js/samples/css-shadow-dom-keyframes/expected.js b/test/js/samples/css-shadow-dom-keyframes/expected.js index 4db714dedc..4d188201eb 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected.js @@ -10,7 +10,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div; return { diff --git a/test/js/samples/data-attribute/expected.js b/test/js/samples/data-attribute/expected.js index 97c4faf65b..8c30e6f6db 100644 --- a/test/js/samples/data-attribute/expected.js +++ b/test/js/samples/data-attribute/expected.js @@ -11,7 +11,7 @@ import { space } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div0; let t; let div1; diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index 2a0445663e..c18eb8699c 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -18,7 +18,7 @@ import { const file = undefined; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let h1; let t0; let t1; 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 a5e7af3cea..74be0c60b3 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -23,6 +23,7 @@ const file = undefined; function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[4] = list[i]; + child_ctx.root = ctx.root; return child_ctx; } @@ -84,7 +85,7 @@ function create_each_block(ctx) { return block; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let t0; let p; let t1; diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index 3e16d354e4..a4b22a4bd4 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -23,6 +23,7 @@ const file = undefined; function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[2] = list[i]; + child_ctx.root = ctx.root; return child_ctx; } @@ -78,7 +79,7 @@ function create_each_block(ctx) { return block; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let t0; let p; let t1; diff --git a/test/js/samples/debug-hoisted/expected.js b/test/js/samples/debug-hoisted/expected.js index 984c4e649c..8dbd718404 100644 --- a/test/js/samples/debug-hoisted/expected.js +++ b/test/js/samples/debug-hoisted/expected.js @@ -10,7 +10,7 @@ import { const file = undefined; -function create_fragment(root, ctx) { +function create_fragment(ctx) { const block = { c: function create() { { diff --git a/test/js/samples/debug-no-dependencies/expected.js b/test/js/samples/debug-no-dependencies/expected.js index 8b56922bad..99b20fb239 100644 --- a/test/js/samples/debug-no-dependencies/expected.js +++ b/test/js/samples/debug-no-dependencies/expected.js @@ -21,6 +21,7 @@ function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[0] = list[i]; child_ctx[2] = i; + child_ctx.root = ctx.root; return child_ctx; } @@ -63,7 +64,7 @@ function create_each_block(ctx) { return block; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let each_1_anchor; let each_value = things; validate_each_argument(each_value); diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js index e4a86534a2..9ab7ef6931 100644 --- a/test/js/samples/deconflict-builtins/expected.js +++ b/test/js/samples/deconflict-builtins/expected.js @@ -17,6 +17,7 @@ import { function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[1] = list[i]; + child_ctx.root = ctx.root; return child_ctx; } @@ -44,7 +45,7 @@ function create_each_block(ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let each_1_anchor; let each_value = /*createElement*/ ctx[0]; let each_blocks = []; 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 6ec3dcb8f5..a981d88dca 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -18,7 +18,7 @@ import { const file = undefined; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let p; let t0_value = Math.max(0, /*foo*/ ctx[0]) + ""; let t0; diff --git a/test/js/samples/dont-invalidate-this/expected.js b/test/js/samples/dont-invalidate-this/expected.js index 74cc6b4cae..0b155373a1 100644 --- a/test/js/samples/dont-invalidate-this/expected.js +++ b/test/js/samples/dont-invalidate-this/expected.js @@ -10,7 +10,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let input; let mounted; let dispose; diff --git a/test/js/samples/dynamic-import/expected.js b/test/js/samples/dynamic-import/expected.js index e1fef0f7f0..d1085f431b 100644 --- a/test/js/samples/dynamic-import/expected.js +++ b/test/js/samples/dynamic-import/expected.js @@ -13,7 +13,7 @@ import { import LazyLoad from "./LazyLoad.svelte"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let lazyload; let current; lazyload = new LazyLoad({ props: { load: func } }); diff --git a/test/js/samples/each-block-array-literal/expected.js b/test/js/samples/each-block-array-literal/expected.js index 7b5775923d..d21bd3d315 100644 --- a/test/js/samples/each-block-array-literal/expected.js +++ b/test/js/samples/each-block-array-literal/expected.js @@ -17,6 +17,7 @@ import { function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[5] = list[i]; + child_ctx.root = ctx.root; return child_ctx; } @@ -44,7 +45,7 @@ function create_each_block(ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let each_1_anchor; let each_value = [/*a*/ ctx[0], /*b*/ ctx[1], /*c*/ ctx[2], /*d*/ ctx[3], /*e*/ ctx[4]]; let each_blocks = []; diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index e3b689c65e..98e08a7142 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -20,6 +20,7 @@ function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[4] = list[i]; child_ctx[6] = i; + child_ctx.root = ctx.root; return child_ctx; } @@ -81,7 +82,7 @@ function create_each_block(ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let t0; let p; let t1; diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js index 4b05e81785..23f572e58f 100644 --- a/test/js/samples/each-block-keyed-animated/expected.js +++ b/test/js/samples/each-block-keyed-animated/expected.js @@ -20,6 +20,7 @@ import { function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[1] = list[i]; + child_ctx.root = ctx.root; return child_ctx; } @@ -64,7 +65,7 @@ function create_each_block(key_1, ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let each_blocks = []; let each_1_lookup = new Map(); let each_1_anchor; diff --git a/test/js/samples/each-block-keyed/expected.js b/test/js/samples/each-block-keyed/expected.js index a064e72a13..2c1e13e96e 100644 --- a/test/js/samples/each-block-keyed/expected.js +++ b/test/js/samples/each-block-keyed/expected.js @@ -18,6 +18,7 @@ import { function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); child_ctx[1] = list[i]; + child_ctx.root = ctx.root; return child_ctx; } @@ -49,7 +50,7 @@ function create_each_block(key_1, ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let each_blocks = []; let each_1_lookup = new Map(); let each_1_anchor; diff --git a/test/js/samples/event-handler-dynamic/expected.js b/test/js/samples/event-handler-dynamic/expected.js index fb4596bf68..dacdfe15ac 100644 --- a/test/js/samples/event-handler-dynamic/expected.js +++ b/test/js/samples/event-handler-dynamic/expected.js @@ -16,7 +16,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let p0; let button0; let t1; diff --git a/test/js/samples/event-handler-no-passive/expected.js b/test/js/samples/event-handler-no-passive/expected.js index bddbf312fc..4d4b910d4e 100644 --- a/test/js/samples/event-handler-no-passive/expected.js +++ b/test/js/samples/event-handler-no-passive/expected.js @@ -11,7 +11,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let a; let mounted; let dispose; diff --git a/test/js/samples/event-modifiers/expected.js b/test/js/samples/event-modifiers/expected.js index 8b9e173abb..28db442828 100644 --- a/test/js/samples/event-modifiers/expected.js +++ b/test/js/samples/event-modifiers/expected.js @@ -15,7 +15,7 @@ import { stop_propagation } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div1; let div0; let t1; diff --git a/test/js/samples/head-no-whitespace/expected.js b/test/js/samples/head-no-whitespace/expected.js index da4d343594..444bad3fd4 100644 --- a/test/js/samples/head-no-whitespace/expected.js +++ b/test/js/samples/head-no-whitespace/expected.js @@ -10,7 +10,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let meta0; let meta1; diff --git a/test/js/samples/hoisted-const/expected.js b/test/js/samples/hoisted-const/expected.js index 5fe2b917a6..2842b54751 100644 --- a/test/js/samples/hoisted-const/expected.js +++ b/test/js/samples/hoisted-const/expected.js @@ -9,7 +9,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let b; return { diff --git a/test/js/samples/hoisted-let/expected.js b/test/js/samples/hoisted-let/expected.js index f7532bbb44..285b124118 100644 --- a/test/js/samples/hoisted-let/expected.js +++ b/test/js/samples/hoisted-let/expected.js @@ -9,7 +9,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let b; return { diff --git a/test/js/samples/hydrated-void-element/expected.js b/test/js/samples/hydrated-void-element/expected.js index c219f56328..e53d16d925 100644 --- a/test/js/samples/hydrated-void-element/expected.js +++ b/test/js/samples/hydrated-void-element/expected.js @@ -14,7 +14,7 @@ import { space } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let img; let img_src_value; let t; diff --git a/test/js/samples/if-block-complex/expected.js b/test/js/samples/if-block-complex/expected.js index 830d7db616..a8244de8b0 100644 --- a/test/js/samples/if-block-complex/expected.js +++ b/test/js/samples/if-block-complex/expected.js @@ -28,7 +28,7 @@ function create_if_block(ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let show_if = /*item*/ ctx[0].divider && /*item*/ ctx[0].divider.includes(1); let if_block_anchor; let if_block = show_if && create_if_block(ctx); diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js index 8908e819c6..c67b33fa85 100644 --- a/test/js/samples/if-block-no-update/expected.js +++ b/test/js/samples/if-block-no-update/expected.js @@ -45,7 +45,7 @@ function create_if_block(ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let if_block_anchor; function select_block_type(ctx, dirty) { diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js index d7582367d6..f4994811fb 100644 --- a/test/js/samples/if-block-simple/expected.js +++ b/test/js/samples/if-block-simple/expected.js @@ -27,7 +27,7 @@ function create_if_block(ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let if_block_anchor; let if_block = /*foo*/ ctx[0] && create_if_block(ctx); diff --git a/test/js/samples/import-meta/expected.js b/test/js/samples/import-meta/expected.js index 52a40c4014..ba77398321 100644 --- a/test/js/samples/import-meta/expected.js +++ b/test/js/samples/import-meta/expected.js @@ -10,7 +10,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let t0; let t1; let t2_value = import.meta.url + ""; diff --git a/test/js/samples/initial-context/expected.js b/test/js/samples/initial-context/expected.js index 98642f86c7..592e2a709e 100644 --- a/test/js/samples/initial-context/expected.js +++ b/test/js/samples/initial-context/expected.js @@ -10,7 +10,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let button; let mounted; let dispose; diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js index 0673c38a81..0a9d0a1e8e 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected.js +++ b/test/js/samples/inline-style-optimized-multiple/expected.js @@ -10,7 +10,7 @@ import { set_style } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div; return { diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js index d98c5d4734..0debb03585 100644 --- a/test/js/samples/inline-style-optimized-url/expected.js +++ b/test/js/samples/inline-style-optimized-url/expected.js @@ -10,7 +10,7 @@ import { set_style } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div; return { diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js index ac725d376e..b7db0f1cf3 100644 --- a/test/js/samples/inline-style-optimized/expected.js +++ b/test/js/samples/inline-style-optimized/expected.js @@ -10,7 +10,7 @@ import { set_style } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div; return { diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index 8f46142cf1..0688f14b9b 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -11,7 +11,7 @@ import { space } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div0; let t; let div1; diff --git a/test/js/samples/inline-style-without-updates/expected.js b/test/js/samples/inline-style-without-updates/expected.js index ec620c24a6..375896f259 100644 --- a/test/js/samples/inline-style-without-updates/expected.js +++ b/test/js/samples/inline-style-without-updates/expected.js @@ -10,7 +10,7 @@ import { set_style } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div; return { diff --git a/test/js/samples/input-files/expected.js b/test/js/samples/input-files/expected.js index 64785c2dfe..8adc7443f5 100644 --- a/test/js/samples/input-files/expected.js +++ b/test/js/samples/input-files/expected.js @@ -11,7 +11,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let input; let mounted; let dispose; diff --git a/test/js/samples/input-no-initial-value/expected.js b/test/js/samples/input-no-initial-value/expected.js index 15342023ae..3354aa3111 100644 --- a/test/js/samples/input-no-initial-value/expected.js +++ b/test/js/samples/input-no-initial-value/expected.js @@ -15,7 +15,7 @@ import { space } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let form; let input; let t0; diff --git a/test/js/samples/input-range/expected.js b/test/js/samples/input-range/expected.js index 4935e6cd91..a855ca3653 100644 --- a/test/js/samples/input-range/expected.js +++ b/test/js/samples/input-range/expected.js @@ -14,7 +14,7 @@ import { to_number } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let input; let mounted; let dispose; diff --git a/test/js/samples/input-value/expected.js b/test/js/samples/input-value/expected.js index d036d1edfe..781a2ae603 100644 --- a/test/js/samples/input-value/expected.js +++ b/test/js/samples/input-value/expected.js @@ -14,7 +14,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let input; let t0; let h1; diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index cb5af32045..6c5b215623 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -11,7 +11,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let input; let mounted; let dispose; 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 bcd7ecfda1..7f51c64550 100644 --- a/test/js/samples/instrumentation-script-if-no-block/expected.js +++ b/test/js/samples/instrumentation-script-if-no-block/expected.js @@ -14,7 +14,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let button; let t1; let p; diff --git a/test/js/samples/instrumentation-script-main-block/expected.js b/test/js/samples/instrumentation-script-main-block/expected.js index b6e2f9f201..a471a50b37 100644 --- a/test/js/samples/instrumentation-script-main-block/expected.js +++ b/test/js/samples/instrumentation-script-main-block/expected.js @@ -12,7 +12,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let p; let t0; let t1; 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 73afe3d91a..ea0d65acb9 100644 --- a/test/js/samples/instrumentation-script-x-equals-x/expected.js +++ b/test/js/samples/instrumentation-script-x-equals-x/expected.js @@ -14,7 +14,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let button; let t1; let p; 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 6fa7239074..0c2713a9cc 100644 --- a/test/js/samples/instrumentation-template-if-no-block/expected.js +++ b/test/js/samples/instrumentation-template-if-no-block/expected.js @@ -14,7 +14,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let button; let t1; let p; 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 0e65e9290e..55cd310661 100644 --- a/test/js/samples/instrumentation-template-x-equals-x/expected.js +++ b/test/js/samples/instrumentation-template-x-equals-x/expected.js @@ -14,7 +14,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let button; let t1; let p; diff --git a/test/js/samples/legacy-input-type/expected.js b/test/js/samples/legacy-input-type/expected.js index 7098b140e7..2b76a48522 100644 --- a/test/js/samples/legacy-input-type/expected.js +++ b/test/js/samples/legacy-input-type/expected.js @@ -10,7 +10,7 @@ import { set_input_type } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let input; return { diff --git a/test/js/samples/loop-protect/expected.js b/test/js/samples/loop-protect/expected.js index 0f7a5db8ba..26721d6be6 100644 --- a/test/js/samples/loop-protect/expected.js +++ b/test/js/samples/loop-protect/expected.js @@ -18,7 +18,7 @@ import { const { console: console_1 } = globals; const file = undefined; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div; const block = { diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index 780912f25b..867d4a7dad 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -14,7 +14,7 @@ import { time_ranges_to_array } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let audio; let audio_updating = false; let audio_animationframe; diff --git a/test/js/samples/non-imported-component/expected.js b/test/js/samples/non-imported-component/expected.js index cd2574023f..5a6b8e8bb7 100644 --- a/test/js/samples/non-imported-component/expected.js +++ b/test/js/samples/non-imported-component/expected.js @@ -16,7 +16,7 @@ import { import Imported from "Imported.svelte"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let imported; let t; let nonimported; diff --git a/test/js/samples/non-mutable-reference/expected.js b/test/js/samples/non-mutable-reference/expected.js index 1e658158f5..93f2145a2e 100644 --- a/test/js/samples/non-mutable-reference/expected.js +++ b/test/js/samples/non-mutable-reference/expected.js @@ -9,7 +9,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let h1; return { diff --git a/test/js/samples/optional-chaining/expected.js b/test/js/samples/optional-chaining/expected.js index 670bcbb3f3..8aa94796c1 100644 --- a/test/js/samples/optional-chaining/expected.js +++ b/test/js/samples/optional-chaining/expected.js @@ -17,7 +17,7 @@ import { transition_out } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let t0_value = /*a*/ ctx[0].normal + ""; let t0; let t1_value = /*b*/ ctx[1]?.optional + ""; diff --git a/test/js/samples/reactive-class-optimized/expected.js b/test/js/samples/reactive-class-optimized/expected.js index 5ea2a21c30..b7c2c3a60b 100644 --- a/test/js/samples/reactive-class-optimized/expected.js +++ b/test/js/samples/reactive-class-optimized/expected.js @@ -15,7 +15,7 @@ import { import { reactiveStoreVal, unreactiveExport } from "./store"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div0; let t0; let div1; diff --git a/test/js/samples/select-dynamic-value/expected.js b/test/js/samples/select-dynamic-value/expected.js index 971de67044..8777cd2600 100644 --- a/test/js/samples/select-dynamic-value/expected.js +++ b/test/js/samples/select-dynamic-value/expected.js @@ -11,7 +11,7 @@ import { select_option } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let select; let option0; let option1; diff --git a/test/js/samples/src-attribute-check/expected.js b/test/js/samples/src-attribute-check/expected.js index a4aa046476..93638edfb4 100644 --- a/test/js/samples/src-attribute-check/expected.js +++ b/test/js/samples/src-attribute-check/expected.js @@ -13,7 +13,7 @@ import { space } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let img0; let img0_src_value; let t; diff --git a/test/js/samples/svg-title/expected.js b/test/js/samples/svg-title/expected.js index d4b9fcec27..cd7ae3b551 100644 --- a/test/js/samples/svg-title/expected.js +++ b/test/js/samples/svg-title/expected.js @@ -11,7 +11,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let svg; let title; let t; diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js index 6b967a65d0..b10f569759 100644 --- a/test/js/samples/title/expected.js +++ b/test/js/samples/title/expected.js @@ -1,7 +1,7 @@ /* generated by Svelte vX.Y.Z */ import { SvelteComponent, init, noop, safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let title_value; document.title = title_value = "a " + /*custom*/ ctx[0] + " title"; diff --git a/test/js/samples/transition-local/expected.js b/test/js/samples/transition-local/expected.js index ac958fbc5b..149953e30d 100644 --- a/test/js/samples/transition-local/expected.js +++ b/test/js/samples/transition-local/expected.js @@ -80,7 +80,7 @@ function create_if_block_1(ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let if_block_anchor; let if_block = /*x*/ ctx[0] && create_if_block(ctx); diff --git a/test/js/samples/transition-repeated-outro/expected.js b/test/js/samples/transition-repeated-outro/expected.js index c3d4288438..12483ab91a 100644 --- a/test/js/samples/transition-repeated-outro/expected.js +++ b/test/js/samples/transition-repeated-outro/expected.js @@ -46,7 +46,7 @@ function create_if_block(ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let if_block_anchor; let current; let if_block = /*num*/ ctx[0] < 5 && create_if_block(ctx); diff --git a/test/js/samples/unchanged-expression/expected.js b/test/js/samples/unchanged-expression/expected.js index 5468533717..673d5b6abc 100644 --- a/test/js/samples/unchanged-expression/expected.js +++ b/test/js/samples/unchanged-expression/expected.js @@ -13,7 +13,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div0; let p0; let t1; diff --git a/test/js/samples/unreferenced-state-not-invalidated/expected.js b/test/js/samples/unreferenced-state-not-invalidated/expected.js index 68b2101c91..53044c7ed6 100644 --- a/test/js/samples/unreferenced-state-not-invalidated/expected.js +++ b/test/js/samples/unreferenced-state-not-invalidated/expected.js @@ -14,7 +14,7 @@ import { import { onMount } from "svelte"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let p; let t; diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js index 3bc90000c3..915663add9 100644 --- a/test/js/samples/use-elements-as-anchors/expected.js +++ b/test/js/samples/use-elements-as-anchors/expected.js @@ -101,7 +101,7 @@ function create_if_block(ctx) { }; } -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div; let t0; let p0; 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 b7ce927ef1..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 @@ -9,7 +9,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let div; return { diff --git a/test/js/samples/video-bindings/expected.js b/test/js/samples/video-bindings/expected.js index 86fe224402..8afa670bbb 100644 --- a/test/js/samples/video-bindings/expected.js +++ b/test/js/samples/video-bindings/expected.js @@ -14,7 +14,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let video; let video_updating = false; let video_animationframe; diff --git a/test/js/samples/window-binding-online/expected.js b/test/js/samples/window-binding-online/expected.js index 0d064399b4..887195bce1 100644 --- a/test/js/samples/window-binding-online/expected.js +++ b/test/js/samples/window-binding-online/expected.js @@ -9,7 +9,7 @@ import { safe_not_equal } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let mounted; let dispose; add_render_callback(/*onlinestatuschanged*/ ctx[1]); diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js index bcc4482cf9..09a4d3737d 100644 --- a/test/js/samples/window-binding-scroll/expected.js +++ b/test/js/samples/window-binding-scroll/expected.js @@ -14,7 +14,7 @@ import { text } from "svelte/internal"; -function create_fragment(root, ctx) { +function create_fragment(ctx) { let scrolling = false; let clear_scrolling = () => {