fix: makes keyed each blocks consistent between dev and prod (#10500)

pull/10503/head
Dominic Gannaway 9 months ago committed by GitHub
parent ba0bdc7aa1
commit 2c93c255f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: makes keyed each blocks consistent between dev and prod

@ -2383,8 +2383,7 @@ export const template_visitors = {
/** @type {import('estree').BlockStatement} */ (context.visit(node.fallback)) /** @type {import('estree').BlockStatement} */ (context.visit(node.fallback))
) )
: b.literal(null); : b.literal(null);
const key_function = const key_function = node.key
node.key && ((each_type & EACH_ITEM_REACTIVE) !== 0 || context.state.options.dev)
? b.arrow( ? b.arrow(
[node.context.type === 'Identifier' ? node.context : b.id('$$item'), index], [node.context.type === 'Identifier' ? node.context : b.id('$$item'), index],
b.block( b.block(

Loading…
Cancel
Save