Skip to content

Commit 566f145

Browse files
committed
fix bitmask overflow when using slotted components (sveltejs#4077)
1 parent 691211a commit 566f145

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/compiler/compile/render_dom/Renderer.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ export default class Renderer {
220220
const i = (value / 31) | 0;
221221
const n = 1 << (value % 31);
222222

223-
if (!bitmask[i]) bitmask[i] = { n: 0, names: [] };
223+
if (bitmask.length <= i) {
224+
for (let j = bitmask.length; j <= i; j++) {
225+
bitmask[j] = { n: 0, names: [] };
226+
}
227+
}
224228

225229
bitmask[i].n |= n;
226230
bitmask[i].names.push(name);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
solo: true,
3+
error: `A is not defined`,
4+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<script>
2+
let x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31;
3+
</script>
4+
<A>foo</A>

0 commit comments

Comments
 (0)