From a8b306f0a18775b31b57333d938090eb3934eb29 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Wed, 18 Dec 2019 09:07:16 +0800 Subject: [PATCH] revert remove contextual overflow (#4102) --- src/compiler/compile/render_dom/Block.ts | 9 +- src/compiler/compile/render_dom/Renderer.ts | 17 +++- src/compiler/compile/render_dom/index.ts | 2 +- .../wrappers/shared/get_slot_definition.ts | 46 +++++---- src/runtime/internal/utils.ts | 5 +- .../action-custom-event-handler/expected.js | 4 +- test/js/samples/bind-open/expected.js | 4 +- .../capture-inject-dev-only/expected.js | 6 +- .../expected.js | 4 +- .../samples/component-static-var/expected.js | 6 +- .../expected.js | 4 +- .../expected.js | 4 +- test/js/samples/data-attribute/expected.js | 4 +- test/js/samples/debug-empty/expected.js | 4 +- .../debug-foo-bar-baz-things/expected.js | 10 +- test/js/samples/debug-foo/expected.js | 10 +- test/js/samples/debug-hoisted/expected.js | 4 +- .../samples/debug-no-dependencies/expected.js | 2 +- .../samples/deconflict-builtins/expected.js | 6 +- .../expected.js | 8 +- .../each-block-array-literal/expected.js | 6 +- .../each-block-changed-check/expected.js | 12 +-- .../each-block-keyed-animated/expected.js | 4 +- test/js/samples/each-block-keyed/expected.js | 4 +- .../samples/event-handler-dynamic/expected.js | 4 +- .../js/samples/if-block-no-update/expected.js | 2 +- test/js/samples/if-block-simple/expected.js | 2 +- .../expected.js | 6 +- .../inline-style-optimized-url/expected.js | 4 +- .../inline-style-optimized/expected.js | 4 +- .../inline-style-unoptimized/expected.js | 6 +- .../input-no-initial-value/expected.js | 4 +- test/js/samples/input-range/expected.js | 4 +- .../input-without-blowback-guard/expected.js | 4 +- .../expected.js | 4 +- .../expected.js | 6 +- .../expected.js | 4 +- .../expected.js | 4 +- .../expected.js | 4 +- test/js/samples/media-bindings/expected.js | 10 +- .../expected.js | 4 +- .../expected.js | 2 +- .../samples/select-dynamic-value/expected.js | 4 +- .../samples/src-attribute-check/expected.js | 6 +- test/js/samples/title/expected.js | 4 +- test/js/samples/transition-local/expected.js | 2 +- .../transition-repeated-outro/expected.js | 2 +- .../samples/unchanged-expression/expected.js | 4 +- .../expected.js | 6 +- .../use-elements-as-anchors/expected.js | 2 +- test/js/samples/video-bindings/expected.js | 4 +- .../samples/window-binding-scroll/expected.js | 6 +- .../bitmask-overflow-slot-2/Echo.svelte | 73 ++++++++++++++ .../bitmask-overflow-slot-2/_config.js | 96 +++++++++++++++++++ .../bitmask-overflow-slot-2/main.svelte | 30 ++++++ .../_config.js | 8 ++ .../main.svelte | 13 +++ .../Widget.svelte | 1 + .../_config.js | 3 + .../main.svelte | 12 +++ 60 files changed, 399 insertions(+), 140 deletions(-) create mode 100644 test/runtime/samples/bitmask-overflow-slot-2/Echo.svelte create mode 100644 test/runtime/samples/bitmask-overflow-slot-2/_config.js create mode 100644 test/runtime/samples/bitmask-overflow-slot-2/main.svelte create mode 100644 test/runtime/samples/each-block-recursive-with-function-condition/_config.js create mode 100644 test/runtime/samples/each-block-recursive-with-function-condition/main.svelte create mode 100644 test/runtime/samples/if-block-component-store-function-conditionals/Widget.svelte create mode 100644 test/runtime/samples/if-block-component-store-function-conditionals/_config.js create mode 100644 test/runtime/samples/if-block-component-store-function-conditionals/main.svelte diff --git a/src/compiler/compile/render_dom/Block.ts b/src/compiler/compile/render_dom/Block.ts index 2297f7ed19fa..c8fa88472161 100644 --- a/src/compiler/compile/render_dom/Block.ts +++ b/src/compiler/compile/render_dom/Block.ts @@ -1,7 +1,7 @@ import Renderer from './Renderer'; import Wrapper from './wrappers/shared/Wrapper'; import { b, x } from 'code-red'; -import { Node, Identifier } from 'estree'; +import { Node, Identifier, ArrayPattern } from 'estree'; import { is_head } from './wrappers/shared/is_head'; export interface BlockOptions { @@ -301,7 +301,12 @@ export default class Block { } else { const ctx = this.maintain_context ? x`#new_ctx` : x`#ctx`; - properties.update = x`function #update(${ctx}, #dirty) { + let dirty: Identifier | ArrayPattern = { type: 'Identifier', name: '#dirty' }; + if (!this.renderer.context_overflow && !this.parent) { + dirty = { type: 'ArrayPattern', elements: [dirty] }; + } + + properties.update = x`function #update(${ctx}, ${dirty}) { ${this.maintain_context && b`#ctx = ${ctx};`} ${this.chunks.update} }`; diff --git a/src/compiler/compile/render_dom/Renderer.ts b/src/compiler/compile/render_dom/Renderer.ts index 06d95fb1e654..046a90b68400 100644 --- a/src/compiler/compile/render_dom/Renderer.ts +++ b/src/compiler/compile/render_dom/Renderer.ts @@ -26,6 +26,7 @@ export default class Renderer { context: ContextMember[] = []; context_lookup: Map = new Map(); + context_overflow: boolean; blocks: Array = []; readonly: Set = new Set(); meta_bindings: Array = []; // initial values for e.g. window.innerWidth, if there's a meta tag @@ -96,6 +97,8 @@ export default class Renderer { this.fragment.render(this.block, null, x`#nodes` as Identifier); + this.context_overflow = this.context.length > 31; + this.context.forEach(member => { const { variable } = member; if (variable) { @@ -237,11 +240,15 @@ export default class Renderer { return x`${dirty} & /*${names.join(', ')}*/ 0` as BinaryExpression; } - return bitmask - .map((b, i) => ({ b, i })) - .filter(({ b }) => b) - .map(({ b, i }) => x`${dirty}[${i}] & /*${b.names.join(', ')}*/ ${b.n}`) - .reduce((lhs, rhs) => x`${lhs} | ${rhs}`); + if (renderer.context_overflow) { + return bitmask + .map((b, i) => ({ b, i })) + .filter(({ b }) => b) + .map(({ b, i }) => x`${dirty}[${i}] & /*${b.names.join(', ')}*/ ${b.n}`) + .reduce((lhs, rhs) => x`${lhs} | ${rhs}`); + } + + return x`${dirty} & /*${names.join(', ')}*/ ${bitmask[0].n}` as BinaryExpression; } } as any; } diff --git a/src/compiler/compile/render_dom/index.ts b/src/compiler/compile/render_dom/index.ts index d97c3bc73000..6edb946c2996 100644 --- a/src/compiler/compile/render_dom/index.ts +++ b/src/compiler/compile/render_dom/index.ts @@ -429,7 +429,7 @@ export default function dom( }` as ObjectExpression; let dirty; - if (renderer.context.length > 31) { + if (renderer.context_overflow) { dirty = x`[]`; for (let i = 0; i < renderer.context.length; i += 31) { dirty.elements.push(x`-1`); diff --git a/src/compiler/compile/render_dom/wrappers/shared/get_slot_definition.ts b/src/compiler/compile/render_dom/wrappers/shared/get_slot_definition.ts index 5ac971b9705d..2adbd3b1d063 100644 --- a/src/compiler/compile/render_dom/wrappers/shared/get_slot_definition.ts +++ b/src/compiler/compile/render_dom/wrappers/shared/get_slot_definition.ts @@ -2,6 +2,7 @@ import Let from '../../../nodes/Let'; import { x, p } from 'code-red'; import Block from '../../Block'; import TemplateScope from '../../../nodes/shared/TemplateScope'; +import { BinaryExpression } from 'estree'; export function get_slot_definition(block: Block, scope: TemplateScope, lets: Let[]) { if (lets.length === 0) return { block, scope }; @@ -35,30 +36,39 @@ export function get_slot_definition(block: Block, scope: TemplateScope, lets: Le const changes = { type: 'ParenthesizedExpression', get expression() { - const grouped = []; + if (block.renderer.context_overflow) { + const grouped = []; - Array.from(names).forEach(name => { - const i = context_lookup.get(name).index.value as number; - const g = Math.floor(i / 31); + Array.from(names).forEach(name => { + const i = context_lookup.get(name).index.value as number; + const g = Math.floor(i / 31); - if (!grouped[g]) grouped[g] = []; - grouped[g].push({ name, n: i % 31 }); - }); + if (!grouped[g]) grouped[g] = []; + grouped[g].push({ name, n: i % 31 }); + }); - const elements = []; + const elements = []; - for (let g = 0; g < grouped.length; g += 1) { - elements[g] = grouped[g] - ? grouped[g] - .map(({ name, n }) => x`${name} ? ${1 << n} : 0`) - .reduce((lhs, rhs) => x`${lhs} | ${rhs}`) - : x`0`; + for (let g = 0; g < grouped.length; g += 1) { + elements[g] = grouped[g] + ? grouped[g] + .map(({ name, n }) => x`${name} ? ${1 << n} : 0`) + .reduce((lhs, rhs) => x`${lhs} | ${rhs}`) + : x`0`; + } + + return { + type: 'ArrayExpression', + elements + }; } - return { - type: 'ArrayExpression', - elements - }; + return Array.from(names) + .map(name => { + const i = context_lookup.get(name).index.value as number; + return x`${name} ? ${1 << i} : 0`; + }) + .reduce((lhs, rhs) => x`${lhs} | ${rhs}`) as BinaryExpression; } }; diff --git a/src/runtime/internal/utils.ts b/src/runtime/internal/utils.ts index a125d30d15ec..b844f1dd4c20 100644 --- a/src/runtime/internal/utils.ts +++ b/src/runtime/internal/utils.ts @@ -80,16 +80,17 @@ export function get_slot_changes(definition, $$scope, dirty, fn) { if (definition[2] && fn) { const lets = definition[2](fn(dirty)); - if ($$scope.dirty) { + if (typeof $$scope.dirty === 'object') { const merged = []; const len = Math.max($$scope.dirty.length, lets.length); for (let i = 0; i < len; i += 1) { merged[i] = $$scope.dirty[i] | lets[i]; } + return merged; } - return lets; + return $$scope.dirty | lets; } return $$scope.dirty; diff --git a/test/js/samples/action-custom-event-handler/expected.js b/test/js/samples/action-custom-event-handler/expected.js index 1d4182970726..6c3a2a5b0b30 100644 --- a/test/js/samples/action-custom-event-handler/expected.js +++ b/test/js/samples/action-custom-event-handler/expected.js @@ -23,8 +23,8 @@ function create_fragment(ctx) { insert(target, button, anchor); foo_action = foo.call(null, button, /*foo_function*/ ctx[1]) || ({}); }, - p(ctx, dirty) { - if (is_function(foo_action.update) && dirty[0] & /*bar*/ 1) foo_action.update.call(null, /*foo_function*/ ctx[1]); + p(ctx, [dirty]) { + if (is_function(foo_action.update) && dirty & /*bar*/ 1) foo_action.update.call(null, /*foo_function*/ ctx[1]); }, i: noop, o: noop, diff --git a/test/js/samples/bind-open/expected.js b/test/js/samples/bind-open/expected.js index a54fc9c406a4..d4f148cac9d0 100644 --- a/test/js/samples/bind-open/expected.js +++ b/test/js/samples/bind-open/expected.js @@ -27,8 +27,8 @@ function create_fragment(ctx) { insert(target, details, anchor); details.open = /*open*/ ctx[0]; }, - p(ctx, dirty) { - if (dirty[0] & /*open*/ 1) { + p(ctx, [dirty]) { + if (dirty & /*open*/ 1) { details.open = /*open*/ ctx[0]; } }, diff --git a/test/js/samples/capture-inject-dev-only/expected.js b/test/js/samples/capture-inject-dev-only/expected.js index 87a708c5e148..6c639d9207f6 100644 --- a/test/js/samples/capture-inject-dev-only/expected.js +++ b/test/js/samples/capture-inject-dev-only/expected.js @@ -37,10 +37,10 @@ function create_fragment(ctx) { insert(target, input, anchor); set_input_value(input, /*foo*/ ctx[0]); }, - p(ctx, dirty) { - if (dirty[0] & /*foo*/ 1) set_data(t0, /*foo*/ ctx[0]); + p(ctx, [dirty]) { + if (dirty & /*foo*/ 1) set_data(t0, /*foo*/ ctx[0]); - if (dirty[0] & /*foo*/ 1 && input.value !== /*foo*/ ctx[0]) { + if (dirty & /*foo*/ 1 && input.value !== /*foo*/ ctx[0]) { set_input_value(input, /*foo*/ ctx[0]); } }, diff --git a/test/js/samples/collapses-text-around-comments/expected.js b/test/js/samples/collapses-text-around-comments/expected.js index f9402994a994..6fef0f9490d8 100644 --- a/test/js/samples/collapses-text-around-comments/expected.js +++ b/test/js/samples/collapses-text-around-comments/expected.js @@ -34,8 +34,8 @@ function create_fragment(ctx) { insert(target, p, anchor); append(p, t); }, - p(ctx, dirty) { - if (dirty[0] & /*foo*/ 1) set_data(t, /*foo*/ ctx[0]); + p(ctx, [dirty]) { + if (dirty & /*foo*/ 1) set_data(t, /*foo*/ ctx[0]); }, i: noop, o: noop, diff --git a/test/js/samples/component-static-var/expected.js b/test/js/samples/component-static-var/expected.js index 1f3cd93c3ecd..e01402b6d445 100644 --- a/test/js/samples/component-static-var/expected.js +++ b/test/js/samples/component-static-var/expected.js @@ -46,12 +46,12 @@ function create_fragment(ctx) { set_input_value(input, /*z*/ ctx[0]); current = true; }, - p(ctx, dirty) { + p(ctx, [dirty]) { const bar_changes = {}; - if (dirty[0] & /*z*/ 1) bar_changes.x = /*z*/ ctx[0]; + if (dirty & /*z*/ 1) bar_changes.x = /*z*/ ctx[0]; bar.$set(bar_changes); - if (dirty[0] & /*z*/ 1 && input.value !== /*z*/ ctx[0]) { + if (dirty & /*z*/ 1 && input.value !== /*z*/ ctx[0]) { set_input_value(input, /*z*/ ctx[0]); } }, diff --git a/test/js/samples/component-store-access-invalidate/expected.js b/test/js/samples/component-store-access-invalidate/expected.js index 9fdf0dcb3a45..4c7bfd7009c3 100644 --- a/test/js/samples/component-store-access-invalidate/expected.js +++ b/test/js/samples/component-store-access-invalidate/expected.js @@ -28,8 +28,8 @@ function create_fragment(ctx) { insert(target, h1, anchor); append(h1, t); }, - p(ctx, dirty) { - if (dirty[0] & /*$foo*/ 1) set_data(t, /*$foo*/ ctx[0]); + p(ctx, [dirty]) { + if (dirty & /*$foo*/ 1) set_data(t, /*$foo*/ ctx[0]); }, i: noop, o: noop, diff --git a/test/js/samples/component-store-reassign-invalidate/expected.js b/test/js/samples/component-store-reassign-invalidate/expected.js index 3ce37988e20e..02a74cf22eb3 100644 --- a/test/js/samples/component-store-reassign-invalidate/expected.js +++ b/test/js/samples/component-store-reassign-invalidate/expected.js @@ -39,8 +39,8 @@ function create_fragment(ctx) { insert(target, t1, anchor); insert(target, button, anchor); }, - p(ctx, dirty) { - if (dirty[0] & /*$foo*/ 2) set_data(t0, /*$foo*/ ctx[1]); + p(ctx, [dirty]) { + if (dirty & /*$foo*/ 2) set_data(t0, /*$foo*/ ctx[1]); }, i: noop, o: noop, diff --git a/test/js/samples/data-attribute/expected.js b/test/js/samples/data-attribute/expected.js index 1fbc9616fc0f..49ad2f2626ba 100644 --- a/test/js/samples/data-attribute/expected.js +++ b/test/js/samples/data-attribute/expected.js @@ -29,8 +29,8 @@ function create_fragment(ctx) { insert(target, t, anchor); insert(target, div1, anchor); }, - p(ctx, dirty) { - if (dirty[0] & /*bar*/ 1) { + p(ctx, [dirty]) { + if (dirty & /*bar*/ 1) { attr(div1, "data-foo", /*bar*/ ctx[0]); } }, diff --git a/test/js/samples/debug-empty/expected.js b/test/js/samples/debug-empty/expected.js index 00934982dc86..5821faadf1e8 100644 --- a/test/js/samples/debug-empty/expected.js +++ b/test/js/samples/debug-empty/expected.js @@ -44,8 +44,8 @@ function create_fragment(ctx) { append_dev(h1, t2); insert_dev(target, t3, anchor); }, - p: function update(ctx, dirty) { - if (dirty[0] & /*name*/ 1) set_data_dev(t1, /*name*/ ctx[0]); + p: function update(ctx, [dirty]) { + if (dirty & /*name*/ 1) set_data_dev(t1, /*name*/ ctx[0]); debugger; }, i: noop, 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 c74407a07308..a1d6dba3b355 100644 --- a/test/js/samples/debug-foo-bar-baz-things/expected.js +++ b/test/js/samples/debug-foo-bar-baz-things/expected.js @@ -54,9 +54,9 @@ function create_each_block(ctx) { insert_dev(target, t1, anchor); }, p: function update(ctx, dirty) { - if (dirty[0] & /*things*/ 1 && t0_value !== (t0_value = /*thing*/ ctx[4].name + "")) set_data_dev(t0, t0_value); + if (dirty & /*things*/ 1 && t0_value !== (t0_value = /*thing*/ ctx[4].name + "")) set_data_dev(t0, t0_value); - if (dirty[0] & /*foo, bar, baz, things*/ 15) { + if (dirty & /*foo, bar, baz, things*/ 15) { const foo = /*foo*/ ctx[1]; const bar = /*bar*/ ctx[2]; const baz = /*baz*/ ctx[3]; @@ -119,8 +119,8 @@ function create_fragment(ctx) { append_dev(p, t1); append_dev(p, t2); }, - p: function update(ctx, dirty) { - if (dirty[0] & /*things*/ 1) { + p: function update(ctx, [dirty]) { + if (dirty & /*things*/ 1) { each_value = /*things*/ ctx[0]; let i; @@ -143,7 +143,7 @@ function create_fragment(ctx) { each_blocks.length = each_value.length; } - if (dirty[0] & /*foo*/ 2) set_data_dev(t2, /*foo*/ ctx[1]); + if (dirty & /*foo*/ 2) set_data_dev(t2, /*foo*/ ctx[1]); }, i: noop, o: noop, diff --git a/test/js/samples/debug-foo/expected.js b/test/js/samples/debug-foo/expected.js index 030d15a8848d..af79667cc237 100644 --- a/test/js/samples/debug-foo/expected.js +++ b/test/js/samples/debug-foo/expected.js @@ -51,9 +51,9 @@ function create_each_block(ctx) { insert_dev(target, t1, anchor); }, p: function update(ctx, dirty) { - if (dirty[0] & /*things*/ 1 && t0_value !== (t0_value = /*thing*/ ctx[2].name + "")) set_data_dev(t0, t0_value); + if (dirty & /*things*/ 1 && t0_value !== (t0_value = /*thing*/ ctx[2].name + "")) set_data_dev(t0, t0_value); - if (dirty[0] & /*foo*/ 2) { + if (dirty & /*foo*/ 2) { const foo = /*foo*/ ctx[1]; console.log({ foo }); debugger; @@ -113,8 +113,8 @@ function create_fragment(ctx) { append_dev(p, t1); append_dev(p, t2); }, - p: function update(ctx, dirty) { - if (dirty[0] & /*things*/ 1) { + p: function update(ctx, [dirty]) { + if (dirty & /*things*/ 1) { each_value = /*things*/ ctx[0]; let i; @@ -137,7 +137,7 @@ function create_fragment(ctx) { each_blocks.length = each_value.length; } - if (dirty[0] & /*foo*/ 2) set_data_dev(t2, /*foo*/ ctx[1]); + if (dirty & /*foo*/ 2) set_data_dev(t2, /*foo*/ ctx[1]); }, i: noop, o: noop, diff --git a/test/js/samples/debug-hoisted/expected.js b/test/js/samples/debug-hoisted/expected.js index 1b12f5a5ce9d..eeb946549965 100644 --- a/test/js/samples/debug-hoisted/expected.js +++ b/test/js/samples/debug-hoisted/expected.js @@ -23,8 +23,8 @@ function create_fragment(ctx) { throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); }, m: noop, - p: function update(ctx, dirty) { - if (dirty[0] & /*obj, kobzol*/ 3) { + p: function update(ctx, [dirty]) { + if (dirty & /*obj, kobzol*/ 3) { const obj = /*obj*/ ctx[0]; const kobzol = /*kobzol*/ ctx[1]; console.log({ obj, kobzol }); diff --git a/test/js/samples/debug-no-dependencies/expected.js b/test/js/samples/debug-no-dependencies/expected.js index f10dda2f46d6..054dda795328 100644 --- a/test/js/samples/debug-no-dependencies/expected.js +++ b/test/js/samples/debug-no-dependencies/expected.js @@ -88,7 +88,7 @@ function create_fragment(ctx) { insert_dev(target, each_1_anchor, anchor); }, - p: function update(ctx, dirty) { + p: function update(ctx, [dirty]) { if (dirty & /*things*/ 0) { each_value = things; let i; diff --git a/test/js/samples/deconflict-builtins/expected.js b/test/js/samples/deconflict-builtins/expected.js index 1931024c9cf8..fb98844ef7a9 100644 --- a/test/js/samples/deconflict-builtins/expected.js +++ b/test/js/samples/deconflict-builtins/expected.js @@ -36,7 +36,7 @@ function create_each_block(ctx) { append(span, t); }, p(ctx, dirty) { - if (dirty[0] & /*createElement*/ 1 && t_value !== (t_value = /*node*/ ctx[1] + "")) set_data(t, t_value); + if (dirty & /*createElement*/ 1 && t_value !== (t_value = /*node*/ ctx[1] + "")) set_data(t, t_value); }, d(detaching) { if (detaching) detach(span); @@ -68,8 +68,8 @@ function create_fragment(ctx) { insert(target, each_1_anchor, anchor); }, - p(ctx, dirty) { - if (dirty[0] & /*createElement*/ 1) { + p(ctx, [dirty]) { + if (dirty & /*createElement*/ 1) { each_value = /*createElement*/ ctx[0]; let i; 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 e8e75a4b1a71..beb794a50c7a 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected.js @@ -41,9 +41,9 @@ function create_fragment(ctx) { append_dev(p, t1); append_dev(p, t2); }, - p: function update(ctx, dirty) { - if (dirty[0] & /*foo*/ 1 && t0_value !== (t0_value = Math.max(0, /*foo*/ ctx[0]) + "")) set_data_dev(t0, t0_value); - if (dirty[0] & /*bar*/ 2) set_data_dev(t2, /*bar*/ ctx[1]); + p: function update(ctx, [dirty]) { + if (dirty & /*foo*/ 1 && t0_value !== (t0_value = Math.max(0, /*foo*/ ctx[0]) + "")) set_data_dev(t0, t0_value); + if (dirty & /*bar*/ 2) set_data_dev(t2, /*bar*/ ctx[1]); }, i: noop, o: noop, @@ -86,7 +86,7 @@ function instance($$self, $$props, $$invalidate) { }; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*foo*/ 1) { + if ($$self.$$.dirty & /*foo*/ 1) { $: $$invalidate(1, bar = foo * 2); } }; diff --git a/test/js/samples/each-block-array-literal/expected.js b/test/js/samples/each-block-array-literal/expected.js index 1685fdf70999..10d835cf7805 100644 --- a/test/js/samples/each-block-array-literal/expected.js +++ b/test/js/samples/each-block-array-literal/expected.js @@ -36,7 +36,7 @@ function create_each_block(ctx) { append(span, t); }, p(ctx, dirty) { - if (dirty[0] & /*a, b, c, d, e*/ 31 && t_value !== (t_value = /*num*/ ctx[5] + "")) set_data(t, t_value); + if (dirty & /*a, b, c, d, e*/ 31 && t_value !== (t_value = /*num*/ ctx[5] + "")) set_data(t, t_value); }, d(detaching) { if (detaching) detach(span); @@ -68,8 +68,8 @@ function create_fragment(ctx) { insert(target, each_1_anchor, anchor); }, - p(ctx, dirty) { - if (dirty[0] & /*a, b, c, d, e*/ 31) { + p(ctx, [dirty]) { + if (dirty & /*a, b, c, d, e*/ 31) { each_value = [/*a*/ ctx[0], /*b*/ ctx[1], /*c*/ ctx[2], /*d*/ ctx[3], /*e*/ ctx[4]]; let i; diff --git a/test/js/samples/each-block-changed-check/expected.js b/test/js/samples/each-block-changed-check/expected.js index af5fe2c5f79f..5d88032b8794 100644 --- a/test/js/samples/each-block-changed-check/expected.js +++ b/test/js/samples/each-block-changed-check/expected.js @@ -70,9 +70,9 @@ function create_each_block(ctx) { html_tag.m(div); }, p(ctx, dirty) { - if (dirty[0] & /*comments*/ 1 && t2_value !== (t2_value = /*comment*/ ctx[4].author + "")) set_data(t2, t2_value); - if (dirty[0] & /*elapsed, comments, time*/ 7 && t4_value !== (t4_value = /*elapsed*/ ctx[1](/*comment*/ ctx[4].time, /*time*/ ctx[2]) + "")) set_data(t4, t4_value); - if (dirty[0] & /*comments*/ 1 && raw_value !== (raw_value = /*comment*/ ctx[4].html + "")) html_tag.p(raw_value); + if (dirty & /*comments*/ 1 && t2_value !== (t2_value = /*comment*/ ctx[4].author + "")) set_data(t2, t2_value); + if (dirty & /*elapsed, comments, time*/ 7 && t4_value !== (t4_value = /*elapsed*/ ctx[1](/*comment*/ ctx[4].time, /*time*/ ctx[2]) + "")) set_data(t4, t4_value); + if (dirty & /*comments*/ 1 && raw_value !== (raw_value = /*comment*/ ctx[4].html + "")) html_tag.p(raw_value); }, d(detaching) { if (detaching) detach(div); @@ -110,8 +110,8 @@ function create_fragment(ctx) { insert(target, p, anchor); append(p, t1); }, - p(ctx, dirty) { - if (dirty[0] & /*comments, elapsed, time*/ 7) { + p(ctx, [dirty]) { + if (dirty & /*comments, elapsed, time*/ 7) { each_value = /*comments*/ ctx[0]; let i; @@ -134,7 +134,7 @@ function create_fragment(ctx) { each_blocks.length = each_value.length; } - if (dirty[0] & /*foo*/ 8) set_data(t1, /*foo*/ ctx[3]); + if (dirty & /*foo*/ 8) set_data(t1, /*foo*/ ctx[3]); }, i: noop, o: noop, diff --git a/test/js/samples/each-block-keyed-animated/expected.js b/test/js/samples/each-block-keyed-animated/expected.js index a572ffdf0023..3b697d68607e 100644 --- a/test/js/samples/each-block-keyed-animated/expected.js +++ b/test/js/samples/each-block-keyed-animated/expected.js @@ -44,7 +44,7 @@ function create_each_block(key_1, ctx) { append(div, t); }, p(ctx, dirty) { - if (dirty[0] & /*things*/ 1 && t_value !== (t_value = /*thing*/ ctx[1].name + "")) set_data(t, t_value); + if (dirty & /*things*/ 1 && t_value !== (t_value = /*thing*/ ctx[1].name + "")) set_data(t, t_value); }, r() { rect = div.getBoundingClientRect(); @@ -91,7 +91,7 @@ function create_fragment(ctx) { insert(target, each_1_anchor, anchor); }, - p(ctx, dirty) { + p(ctx, [dirty]) { const each_value = /*things*/ ctx[0]; for (let i = 0; i < each_blocks.length; i += 1) each_blocks[i].r(); each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, fix_and_destroy_block, create_each_block, each_1_anchor, get_each_context); diff --git a/test/js/samples/each-block-keyed/expected.js b/test/js/samples/each-block-keyed/expected.js index 66c38027d7fb..1cd9a31ecee3 100644 --- a/test/js/samples/each-block-keyed/expected.js +++ b/test/js/samples/each-block-keyed/expected.js @@ -40,7 +40,7 @@ function create_each_block(key_1, ctx) { append(div, t); }, p(ctx, dirty) { - if (dirty[0] & /*things*/ 1 && t_value !== (t_value = /*thing*/ ctx[1].name + "")) set_data(t, t_value); + if (dirty & /*things*/ 1 && t_value !== (t_value = /*thing*/ ctx[1].name + "")) set_data(t, t_value); }, d(detaching) { if (detaching) detach(div); @@ -76,7 +76,7 @@ function create_fragment(ctx) { insert(target, each_1_anchor, anchor); }, - p(ctx, dirty) { + p(ctx, [dirty]) { const each_value = /*things*/ ctx[0]; each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, each_1_anchor.parentNode, destroy_block, create_each_block, each_1_anchor, get_each_context); }, diff --git a/test/js/samples/event-handler-dynamic/expected.js b/test/js/samples/event-handler-dynamic/expected.js index 380bcd14e440..34c33151bf2b 100644 --- a/test/js/samples/event-handler-dynamic/expected.js +++ b/test/js/samples/event-handler-dynamic/expected.js @@ -61,9 +61,9 @@ function create_fragment(ctx) { insert(target, t5, anchor); insert(target, button2, anchor); }, - p(new_ctx, dirty) { + p(new_ctx, [dirty]) { ctx = new_ctx; - if (dirty[0] & /*number*/ 2) set_data(t4, /*number*/ ctx[1]); + if (dirty & /*number*/ 2) set_data(t4, /*number*/ ctx[1]); }, i: noop, o: noop, diff --git a/test/js/samples/if-block-no-update/expected.js b/test/js/samples/if-block-no-update/expected.js index 17bdfaaef356..f225c221bfe3 100644 --- a/test/js/samples/if-block-no-update/expected.js +++ b/test/js/samples/if-block-no-update/expected.js @@ -65,7 +65,7 @@ function create_fragment(ctx) { if_block.m(target, anchor); insert(target, if_block_anchor, anchor); }, - p(ctx, dirty) { + p(ctx, [dirty]) { if (current_block_type !== (current_block_type = select_block_type(ctx, dirty))) { if_block.d(1); if_block = current_block_type(ctx); diff --git a/test/js/samples/if-block-simple/expected.js b/test/js/samples/if-block-simple/expected.js index 779dfbf8f268..b9fad863e2c0 100644 --- a/test/js/samples/if-block-simple/expected.js +++ b/test/js/samples/if-block-simple/expected.js @@ -40,7 +40,7 @@ function create_fragment(ctx) { if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); }, - p(ctx, dirty) { + p(ctx, [dirty]) { if (/*foo*/ ctx[0]) { if (!if_block) { if_block = create_if_block(ctx); diff --git a/test/js/samples/inline-style-optimized-multiple/expected.js b/test/js/samples/inline-style-optimized-multiple/expected.js index 8782fa841f4f..84a38abd7bbe 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected.js +++ b/test/js/samples/inline-style-optimized-multiple/expected.js @@ -22,12 +22,12 @@ function create_fragment(ctx) { m(target, anchor) { insert(target, div, anchor); }, - p(ctx, dirty) { - if (dirty[0] & /*color*/ 1) { + p(ctx, [dirty]) { + if (dirty & /*color*/ 1) { set_style(div, "color", /*color*/ ctx[0]); } - if (dirty[0] & /*x, y*/ 6) { + if (dirty & /*x, y*/ 6) { set_style(div, "transform", "translate(" + /*x*/ ctx[1] + "px," + /*y*/ ctx[2] + "px)"); } }, diff --git a/test/js/samples/inline-style-optimized-url/expected.js b/test/js/samples/inline-style-optimized-url/expected.js index a3f4d0c06195..77870348a572 100644 --- a/test/js/samples/inline-style-optimized-url/expected.js +++ b/test/js/samples/inline-style-optimized-url/expected.js @@ -21,8 +21,8 @@ function create_fragment(ctx) { m(target, anchor) { insert(target, div, anchor); }, - p(ctx, dirty) { - if (dirty[0] & /*data*/ 1) { + p(ctx, [dirty]) { + if (dirty & /*data*/ 1) { set_style(div, "background", "url(data:image/png;base64," + /*data*/ ctx[0] + ")"); } }, diff --git a/test/js/samples/inline-style-optimized/expected.js b/test/js/samples/inline-style-optimized/expected.js index 44cea48c6bb5..5bef284f0946 100644 --- a/test/js/samples/inline-style-optimized/expected.js +++ b/test/js/samples/inline-style-optimized/expected.js @@ -21,8 +21,8 @@ function create_fragment(ctx) { m(target, anchor) { insert(target, div, anchor); }, - p(ctx, dirty) { - if (dirty[0] & /*color*/ 1) { + p(ctx, [dirty]) { + if (dirty & /*color*/ 1) { set_style(div, "color", /*color*/ ctx[0]); } }, diff --git a/test/js/samples/inline-style-unoptimized/expected.js b/test/js/samples/inline-style-unoptimized/expected.js index 90aaf6c80118..fdff685eade2 100644 --- a/test/js/samples/inline-style-unoptimized/expected.js +++ b/test/js/samples/inline-style-unoptimized/expected.js @@ -30,12 +30,12 @@ function create_fragment(ctx) { insert(target, t, anchor); insert(target, div1, anchor); }, - p(ctx, dirty) { - if (dirty[0] & /*style*/ 1) { + p(ctx, [dirty]) { + if (dirty & /*style*/ 1) { attr(div0, "style", /*style*/ ctx[0]); } - if (dirty[0] & /*key, value*/ 6 && div1_style_value !== (div1_style_value = "" + (/*key*/ ctx[1] + ": " + /*value*/ ctx[2]))) { + if (dirty & /*key, value*/ 6 && div1_style_value !== (div1_style_value = "" + (/*key*/ ctx[1] + ": " + /*value*/ ctx[2]))) { attr(div1, "style", div1_style_value); } }, diff --git a/test/js/samples/input-no-initial-value/expected.js b/test/js/samples/input-no-initial-value/expected.js index bd46faa0f833..8ff2b2798b74 100644 --- a/test/js/samples/input-no-initial-value/expected.js +++ b/test/js/samples/input-no-initial-value/expected.js @@ -44,8 +44,8 @@ function create_fragment(ctx) { append(form, t0); append(form, button); }, - p(ctx, dirty) { - if (dirty[0] & /*test*/ 1 && input.value !== /*test*/ ctx[0]) { + p(ctx, [dirty]) { + if (dirty & /*test*/ 1 && input.value !== /*test*/ ctx[0]) { set_input_value(input, /*test*/ ctx[0]); } }, diff --git a/test/js/samples/input-range/expected.js b/test/js/samples/input-range/expected.js index 9274328330be..5a074d9754b3 100644 --- a/test/js/samples/input-range/expected.js +++ b/test/js/samples/input-range/expected.js @@ -32,8 +32,8 @@ function create_fragment(ctx) { insert(target, input, anchor); set_input_value(input, /*value*/ ctx[0]); }, - p(ctx, dirty) { - if (dirty[0] & /*value*/ 1) { + p(ctx, [dirty]) { + if (dirty & /*value*/ 1) { set_input_value(input, /*value*/ ctx[0]); } }, diff --git a/test/js/samples/input-without-blowback-guard/expected.js b/test/js/samples/input-without-blowback-guard/expected.js index 05a1831a3eb2..344976ade602 100644 --- a/test/js/samples/input-without-blowback-guard/expected.js +++ b/test/js/samples/input-without-blowback-guard/expected.js @@ -25,8 +25,8 @@ function create_fragment(ctx) { insert(target, input, anchor); input.checked = /*foo*/ ctx[0]; }, - p(ctx, dirty) { - if (dirty[0] & /*foo*/ 1) { + p(ctx, [dirty]) { + if (dirty & /*foo*/ 1) { input.checked = /*foo*/ ctx[0]; } }, 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 0cfbe7c33921..4127a6d7d693 100644 --- a/test/js/samples/instrumentation-script-if-no-block/expected.js +++ b/test/js/samples/instrumentation-script-if-no-block/expected.js @@ -39,8 +39,8 @@ function create_fragment(ctx) { append(p, t2); append(p, t3); }, - p(ctx, dirty) { - if (dirty[0] & /*x*/ 1) set_data(t3, /*x*/ ctx[0]); + p(ctx, [dirty]) { + if (dirty & /*x*/ 1) set_data(t3, /*x*/ ctx[0]); }, i: noop, o: noop, diff --git a/test/js/samples/instrumentation-script-main-block/expected.js b/test/js/samples/instrumentation-script-main-block/expected.js index 35650e813460..bc809246028b 100644 --- a/test/js/samples/instrumentation-script-main-block/expected.js +++ b/test/js/samples/instrumentation-script-main-block/expected.js @@ -28,8 +28,8 @@ function create_fragment(ctx) { append(p, t0); append(p, t1); }, - p(ctx, dirty) { - if (dirty[0] & /*x*/ 1) set_data(t1, /*x*/ ctx[0]); + p(ctx, [dirty]) { + if (dirty & /*x*/ 1) set_data(t1, /*x*/ ctx[0]); }, i: noop, o: noop, @@ -57,7 +57,7 @@ function instance($$self, $$props, $$invalidate) { ); $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*x, y*/ 3) { + if ($$self.$$.dirty & /*x, y*/ 3) { $: $$invalidate(0, x += y); } }; 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 be84844254d3..0d4493baf3c0 100644 --- a/test/js/samples/instrumentation-script-x-equals-x/expected.js +++ b/test/js/samples/instrumentation-script-x-equals-x/expected.js @@ -40,8 +40,8 @@ function create_fragment(ctx) { append(p, t2); append(p, t3); }, - p(ctx, dirty) { - if (dirty[0] & /*things*/ 1 && t3_value !== (t3_value = /*things*/ ctx[0].length + "")) set_data(t3, t3_value); + p(ctx, [dirty]) { + if (dirty & /*things*/ 1 && t3_value !== (t3_value = /*things*/ ctx[0].length + "")) set_data(t3, t3_value); }, i: noop, o: noop, 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 4abbe0300e65..0bd627eb87b3 100644 --- a/test/js/samples/instrumentation-template-if-no-block/expected.js +++ b/test/js/samples/instrumentation-template-if-no-block/expected.js @@ -39,8 +39,8 @@ function create_fragment(ctx) { append(p, t2); append(p, t3); }, - p(ctx, dirty) { - if (dirty[0] & /*x*/ 1) set_data(t3, /*x*/ ctx[0]); + p(ctx, [dirty]) { + if (dirty & /*x*/ 1) set_data(t3, /*x*/ ctx[0]); }, i: noop, o: noop, 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 22ea219233f9..e049a6d39be8 100644 --- a/test/js/samples/instrumentation-template-x-equals-x/expected.js +++ b/test/js/samples/instrumentation-template-x-equals-x/expected.js @@ -40,8 +40,8 @@ function create_fragment(ctx) { append(p, t2); append(p, t3); }, - p(ctx, dirty) { - if (dirty[0] & /*things*/ 1 && t3_value !== (t3_value = /*things*/ ctx[0].length + "")) set_data(t3, t3_value); + p(ctx, [dirty]) { + if (dirty & /*things*/ 1 && t3_value !== (t3_value = /*things*/ ctx[0].length + "")) set_data(t3, t3_value); }, i: noop, o: noop, diff --git a/test/js/samples/media-bindings/expected.js b/test/js/samples/media-bindings/expected.js index 25dde4319fd9..bfb1b8911d39 100644 --- a/test/js/samples/media-bindings/expected.js +++ b/test/js/samples/media-bindings/expected.js @@ -67,20 +67,20 @@ function create_fragment(ctx) { audio.playbackRate = /*playbackRate*/ ctx[7]; } }, - p(ctx, dirty) { - if (!audio_updating && dirty[0] & /*currentTime*/ 8 && !isNaN(/*currentTime*/ ctx[3])) { + p(ctx, [dirty]) { + if (!audio_updating && dirty & /*currentTime*/ 8 && !isNaN(/*currentTime*/ ctx[3])) { audio.currentTime = /*currentTime*/ ctx[3]; } - if (dirty[0] & /*paused*/ 32 && audio_is_paused !== (audio_is_paused = /*paused*/ ctx[5])) { + if (dirty & /*paused*/ 32 && audio_is_paused !== (audio_is_paused = /*paused*/ ctx[5])) { audio[audio_is_paused ? "pause" : "play"](); } - if (dirty[0] & /*volume*/ 64 && !isNaN(/*volume*/ ctx[6])) { + if (dirty & /*volume*/ 64 && !isNaN(/*volume*/ ctx[6])) { audio.volume = /*volume*/ ctx[6]; } - if (dirty[0] & /*playbackRate*/ 128 && !isNaN(/*playbackRate*/ ctx[7])) { + if (dirty & /*playbackRate*/ 128 && !isNaN(/*playbackRate*/ ctx[7])) { audio.playbackRate = /*playbackRate*/ ctx[7]; } 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 864a252a9007..3d266f10acfb 100644 --- a/test/js/samples/reactive-values-non-topologically-ordered/expected.js +++ b/test/js/samples/reactive-values-non-topologically-ordered/expected.js @@ -11,11 +11,11 @@ function instance($$self, $$props, $$invalidate) { }; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*x*/ 1) { + if ($$self.$$.dirty & /*x*/ 1) { $: $$invalidate(2, b = x); } - if ($$self.$$.dirty[0] & /*b*/ 4) { + if ($$self.$$.dirty & /*b*/ 4) { $: a = b; } }; 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 b3ede8dc8091..38bd356d85e4 100644 --- a/test/js/samples/reactive-values-non-writable-dependencies/expected.js +++ b/test/js/samples/reactive-values-non-writable-dependencies/expected.js @@ -11,7 +11,7 @@ function instance($$self, $$props, $$invalidate) { }; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*a, b*/ 3) { + if ($$self.$$.dirty & /*a, b*/ 3) { $: console.log("max", Math.max(a, b)); } }; diff --git a/test/js/samples/select-dynamic-value/expected.js b/test/js/samples/select-dynamic-value/expected.js index 9b63c0e75e2d..a93a47bd3ac4 100644 --- a/test/js/samples/select-dynamic-value/expected.js +++ b/test/js/samples/select-dynamic-value/expected.js @@ -43,8 +43,8 @@ function create_fragment(ctx) { } } }, - p(ctx, dirty) { - if (dirty[0] & /*current*/ 1 && select_value_value !== (select_value_value = /*current*/ ctx[0])) { + p(ctx, [dirty]) { + if (dirty & /*current*/ 1 && select_value_value !== (select_value_value = /*current*/ ctx[0])) { for (var i = 0; i < select.options.length; i += 1) { var option = select.options[i]; diff --git a/test/js/samples/src-attribute-check/expected.js b/test/js/samples/src-attribute-check/expected.js index e4ec12fc042b..e03b3a6ba7ee 100644 --- a/test/js/samples/src-attribute-check/expected.js +++ b/test/js/samples/src-attribute-check/expected.js @@ -44,12 +44,12 @@ function create_fragment(ctx) { insert(target, t, anchor); insert(target, img1, anchor); }, - p(ctx, dirty) { - if (dirty[0] & /*url*/ 1 && img0.src !== (img0_src_value = /*url*/ ctx[0])) { + p(ctx, [dirty]) { + if (dirty & /*url*/ 1 && img0.src !== (img0_src_value = /*url*/ ctx[0])) { attr(img0, "src", img0_src_value); } - if (dirty[0] & /*slug*/ 2 && img1.src !== (img1_src_value = "" + (/*slug*/ ctx[1] + ".jpg"))) { + if (dirty & /*slug*/ 2 && img1.src !== (img1_src_value = "" + (/*slug*/ ctx[1] + ".jpg"))) { attr(img1, "src", img1_src_value); } }, diff --git a/test/js/samples/title/expected.js b/test/js/samples/title/expected.js index d6cac09f222a..d4e7e1a58491 100644 --- a/test/js/samples/title/expected.js +++ b/test/js/samples/title/expected.js @@ -8,8 +8,8 @@ function create_fragment(ctx) { return { c: noop, m: noop, - p(ctx, dirty) { - if (dirty[0] & /*custom*/ 1 && title_value !== (title_value = "a " + /*custom*/ ctx[0] + " title")) { + p(ctx, [dirty]) { + if (dirty & /*custom*/ 1 && title_value !== (title_value = "a " + /*custom*/ ctx[0] + " title")) { document.title = title_value; } }, diff --git a/test/js/samples/transition-local/expected.js b/test/js/samples/transition-local/expected.js index 516a4de40857..a5d3b6318fe5 100644 --- a/test/js/samples/transition-local/expected.js +++ b/test/js/samples/transition-local/expected.js @@ -91,7 +91,7 @@ function create_fragment(ctx) { if (if_block) if_block.m(target, anchor); insert(target, if_block_anchor, anchor); }, - p(ctx, dirty) { + p(ctx, [dirty]) { if (/*x*/ ctx[0]) { if (if_block) { if_block.p(ctx, dirty); diff --git a/test/js/samples/transition-repeated-outro/expected.js b/test/js/samples/transition-repeated-outro/expected.js index e276058399e2..6f071328a491 100644 --- a/test/js/samples/transition-repeated-outro/expected.js +++ b/test/js/samples/transition-repeated-outro/expected.js @@ -61,7 +61,7 @@ function create_fragment(ctx) { insert(target, if_block_anchor, anchor); current = true; }, - p(ctx, dirty) { + p(ctx, [dirty]) { if (/*num*/ ctx[0] < 5) { if (!if_block) { if_block = create_if_block(ctx); diff --git a/test/js/samples/unchanged-expression/expected.js b/test/js/samples/unchanged-expression/expected.js index bf40d74b5ba3..673d5b6abc8d 100644 --- a/test/js/samples/unchanged-expression/expected.js +++ b/test/js/samples/unchanged-expression/expected.js @@ -56,8 +56,8 @@ function create_fragment(ctx) { append(p3, t8); append(p3, t9); }, - p(ctx, dirty) { - if (dirty[0] & /*world3*/ 1) set_data(t9, /*world3*/ ctx[0]); + p(ctx, [dirty]) { + if (dirty & /*world3*/ 1) set_data(t9, /*world3*/ ctx[0]); }, i: noop, o: noop, diff --git a/test/js/samples/unreferenced-state-not-invalidated/expected.js b/test/js/samples/unreferenced-state-not-invalidated/expected.js index 52e45725cf4e..b10ea815b966 100644 --- a/test/js/samples/unreferenced-state-not-invalidated/expected.js +++ b/test/js/samples/unreferenced-state-not-invalidated/expected.js @@ -27,8 +27,8 @@ function create_fragment(ctx) { insert(target, p, anchor); append(p, t); }, - p(ctx, dirty) { - if (dirty[0] & /*y*/ 1) set_data(t, /*y*/ ctx[0]); + p(ctx, [dirty]) { + if (dirty & /*y*/ 1) set_data(t, /*y*/ ctx[0]); }, i: noop, o: noop, @@ -58,7 +58,7 @@ function instance($$self, $$props, $$invalidate) { let y; $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*b*/ 2) { + if ($$self.$$.dirty & /*b*/ 2) { $: $$invalidate(0, y = b * 2); } }; diff --git a/test/js/samples/use-elements-as-anchors/expected.js b/test/js/samples/use-elements-as-anchors/expected.js index 62bb6ed7d81c..52635e9b7878 100644 --- a/test/js/samples/use-elements-as-anchors/expected.js +++ b/test/js/samples/use-elements-as-anchors/expected.js @@ -155,7 +155,7 @@ function create_fragment(ctx) { if (if_block4) if_block4.m(target, anchor); insert(target, if_block4_anchor, anchor); }, - p(ctx, dirty) { + p(ctx, [dirty]) { if (/*a*/ ctx[0]) { if (!if_block0) { if_block0 = create_if_block_4(ctx); diff --git a/test/js/samples/video-bindings/expected.js b/test/js/samples/video-bindings/expected.js index 9aa2a2c5a686..e3d48f9922cd 100644 --- a/test/js/samples/video-bindings/expected.js +++ b/test/js/samples/video-bindings/expected.js @@ -47,8 +47,8 @@ function create_fragment(ctx) { insert(target, video, anchor); video_resize_listener = add_resize_listener(video, /*video_elementresize_handler*/ ctx[4].bind(video)); }, - p(ctx, dirty) { - if (!video_updating && dirty[0] & /*currentTime*/ 1 && !isNaN(/*currentTime*/ ctx[0])) { + p(ctx, [dirty]) { + if (!video_updating && dirty & /*currentTime*/ 1 && !isNaN(/*currentTime*/ ctx[0])) { video.currentTime = /*currentTime*/ ctx[0]; } diff --git a/test/js/samples/window-binding-scroll/expected.js b/test/js/samples/window-binding-scroll/expected.js index 640b19eba810..f79212e25e66 100644 --- a/test/js/samples/window-binding-scroll/expected.js +++ b/test/js/samples/window-binding-scroll/expected.js @@ -46,15 +46,15 @@ function create_fragment(ctx) { append(p, t0); append(p, t1); }, - p(ctx, dirty) { - if (dirty[0] & /*y*/ 1 && !scrolling) { + p(ctx, [dirty]) { + if (dirty & /*y*/ 1 && !scrolling) { scrolling = true; clearTimeout(scrolling_timeout); scrollTo(window.pageXOffset, /*y*/ ctx[0]); scrolling_timeout = setTimeout(clear_scrolling, 100); } - if (dirty[0] & /*y*/ 1) set_data(t1, /*y*/ ctx[0]); + if (dirty & /*y*/ 1) set_data(t1, /*y*/ ctx[0]); }, i: noop, o: noop, diff --git a/test/runtime/samples/bitmask-overflow-slot-2/Echo.svelte b/test/runtime/samples/bitmask-overflow-slot-2/Echo.svelte new file mode 100644 index 000000000000..c8905184dc1b --- /dev/null +++ b/test/runtime/samples/bitmask-overflow-slot-2/Echo.svelte @@ -0,0 +1,73 @@ + + +

{d1}

+

{d2}

+

{d3}

+

{d4}

+

{d5}

+

{d6}

+

{d7}

+

{d8}

+

{d9}

+

{d10}

+

{d11}

+

{d12}

+

{d13}

+

{d14}

+

{d15}

+

{d16}

+

{d17}

+

{d18}

+

{d19}

+

{d20}

+

{d21}

+

{d22}

+

{d23}

+

{d24}

+

{d25}

+

{d26}

+

{d27}

+

{d28}

+

{d29}

+

{d30}

+

{d31}

+

{d32}

+

{d33}

+ + \ No newline at end of file diff --git a/test/runtime/samples/bitmask-overflow-slot-2/_config.js b/test/runtime/samples/bitmask-overflow-slot-2/_config.js new file mode 100644 index 000000000000..b01bd81e00bb --- /dev/null +++ b/test/runtime/samples/bitmask-overflow-slot-2/_config.js @@ -0,0 +1,96 @@ +export default { + html: ` +

d1

+

d2

+

d3

+

d4

+

d5

+

d6

+

d7

+

d8

+

d9

+

d10

+

d11

+

d12

+

d13

+

d14

+

d15

+

d16

+

d17

+

d18

+

d19

+

d20

+

d21

+

d22

+

d23

+

d24

+

d25

+

d26

+

d27

+

d28

+

d29

+

d30

+

d31

+

2

+

1

+

0:1

+

2:1

+

0

+

1

+

2

+ `, + + test({ assert, component, target }) { + component.reads = {}; + + component._0 = 'a'; + component._1 = 'b'; + component._2 = 'c'; + + assert.htmlEqual(target.innerHTML, ` +

d1

+

d2

+

d3

+

d4

+

d5

+

d6

+

d7

+

d8

+

d9

+

d10

+

d11

+

d12

+

d13

+

d14

+

d15

+

d16

+

d17

+

d18

+

d19

+

d20

+

d21

+

d22

+

d23

+

d24

+

d25

+

d26

+

d27

+

d28

+

d29

+

d30

+

d31

+

c

+

b

+

a:b

+

c:b

+

a

+

b

+

c

+ `); + + assert.deepEqual(component.reads, { + _0: 2, + _1: 2, + }); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/bitmask-overflow-slot-2/main.svelte b/test/runtime/samples/bitmask-overflow-slot-2/main.svelte new file mode 100644 index 000000000000..c15b4d532294 --- /dev/null +++ b/test/runtime/samples/bitmask-overflow-slot-2/main.svelte @@ -0,0 +1,30 @@ + + + +

{bar}

+

{dummy}

+

{_0}

+

{_1}

+

{_2}

+
\ No newline at end of file diff --git a/test/runtime/samples/each-block-recursive-with-function-condition/_config.js b/test/runtime/samples/each-block-recursive-with-function-condition/_config.js new file mode 100644 index 000000000000..0795576bae0d --- /dev/null +++ b/test/runtime/samples/each-block-recursive-with-function-condition/_config.js @@ -0,0 +1,8 @@ +export default { + html: ` +

OK

+

OK

+
one
+
two
+ ` +}; diff --git a/test/runtime/samples/each-block-recursive-with-function-condition/main.svelte b/test/runtime/samples/each-block-recursive-with-function-condition/main.svelte new file mode 100644 index 000000000000..9b62c03cf618 --- /dev/null +++ b/test/runtime/samples/each-block-recursive-with-function-condition/main.svelte @@ -0,0 +1,13 @@ + + +{#each data as datum} + {#if datum.foo && a()} +

OK

+ + {:else} +
{datum.bar}
+ {/if} +{/each} diff --git a/test/runtime/samples/if-block-component-store-function-conditionals/Widget.svelte b/test/runtime/samples/if-block-component-store-function-conditionals/Widget.svelte new file mode 100644 index 000000000000..a74ce95de527 --- /dev/null +++ b/test/runtime/samples/if-block-component-store-function-conditionals/Widget.svelte @@ -0,0 +1 @@ +

OK

\ No newline at end of file diff --git a/test/runtime/samples/if-block-component-store-function-conditionals/_config.js b/test/runtime/samples/if-block-component-store-function-conditionals/_config.js new file mode 100644 index 000000000000..db171f2fd18d --- /dev/null +++ b/test/runtime/samples/if-block-component-store-function-conditionals/_config.js @@ -0,0 +1,3 @@ +export default { + html: '

OK

', +}; diff --git a/test/runtime/samples/if-block-component-store-function-conditionals/main.svelte b/test/runtime/samples/if-block-component-store-function-conditionals/main.svelte new file mode 100644 index 000000000000..765654f0d2a8 --- /dev/null +++ b/test/runtime/samples/if-block-component-store-function-conditionals/main.svelte @@ -0,0 +1,12 @@ + + +{#if $a || b() } + +{:else} +
fail
+{/if} \ No newline at end of file