From f8a8c06ee3505408a9fcd69423cd778092e97d53 Mon Sep 17 00:00:00 2001 From: Conduitry Date: Tue, 10 Dec 2019 09:24:40 -0500 Subject: [PATCH] fix bitmask overflow when using slotted components (#4077) --- src/compiler/compile/render_dom/Renderer.ts | 4 ++-- test/runtime/samples/bitmask-overflow-3/_config.js | 3 +++ test/runtime/samples/bitmask-overflow-3/main.svelte | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 test/runtime/samples/bitmask-overflow-3/_config.js create mode 100644 test/runtime/samples/bitmask-overflow-3/main.svelte diff --git a/src/compiler/compile/render_dom/Renderer.ts b/src/compiler/compile/render_dom/Renderer.ts index 0b2dc6bfbc..046a90b684 100644 --- a/src/compiler/compile/render_dom/Renderer.ts +++ b/src/compiler/compile/render_dom/Renderer.ts @@ -86,8 +86,6 @@ export default class Renderer { null ); - this.context_overflow = this.context.length > 31; - // TODO messy this.blocks.forEach(block => { if (block instanceof Block) { @@ -99,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) { diff --git a/test/runtime/samples/bitmask-overflow-3/_config.js b/test/runtime/samples/bitmask-overflow-3/_config.js new file mode 100644 index 0000000000..aee7d3237e --- /dev/null +++ b/test/runtime/samples/bitmask-overflow-3/_config.js @@ -0,0 +1,3 @@ +export default { + error: `A is not defined`, +}; \ No newline at end of file diff --git a/test/runtime/samples/bitmask-overflow-3/main.svelte b/test/runtime/samples/bitmask-overflow-3/main.svelte new file mode 100644 index 0000000000..aa2c56a147 --- /dev/null +++ b/test/runtime/samples/bitmask-overflow-3/main.svelte @@ -0,0 +1,4 @@ + +foo