chore: make each items reassignable

gh-12254
Rich Harris 7 days ago
parent bcf23cafce
commit 158b3436c3

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: make each items reassignable

@ -1347,7 +1347,7 @@ const template_visitors = {
state.init.push(b.const(array_id, b.call('$.ensure_array_like', collection)));
/** @type {import('estree').Statement[]} */
const each = [b.const(item, b.member(array_id, index, true))];
const each = [b.let(item, b.member(array_id, index, true))];
if (node.context.type !== 'Identifier') {
each.push(b.const(/** @type {import('estree').Pattern} */ (node.context), item));

Loading…
Cancel
Save