File tree 2 files changed +13
-9
lines changed
packages/svelte/src/compiler/phases/3-transform/client/visitors
2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " svelte " : patch
3
+ ---
4
+
5
+ fix: makes keyed each blocks consistent between dev and prod
Original file line number Diff line number Diff line change @@ -2376,17 +2376,16 @@ export const template_visitors = {
2376
2376
/** @type {import('estree').BlockStatement } */ ( context . visit ( node . fallback ) )
2377
2377
)
2378
2378
: b . literal ( null ) ;
2379
- const key_function =
2380
- node . key && ( ( each_type & EACH_ITEM_REACTIVE ) !== 0 || context . state . options . dev )
2381
- ? b . arrow (
2382
- [ node . context . type === 'Identifier' ? node . context : b . id ( '$$item' ) , index ] ,
2383
- b . block (
2384
- declarations . concat (
2385
- b . return ( /** @type {import('estree').Expression } */ ( context . visit ( node . key ) ) )
2386
- )
2379
+ const key_function = node . key
2380
+ ? b . arrow (
2381
+ [ node . context . type === 'Identifier' ? node . context : b . id ( '$$item' ) , index ] ,
2382
+ b . block (
2383
+ declarations . concat (
2384
+ b . return ( /** @type {import('estree').Expression } */ ( context . visit ( node . key ) ) )
2387
2385
)
2388
2386
)
2389
- : b . literal ( null ) ;
2387
+ )
2388
+ : b . literal ( null ) ;
2390
2389
2391
2390
if ( node . index && each_node_meta . contains_group_binding ) {
2392
2391
// We needed to create a unique identifier for the index above, but we want to use the
You can’t perform that action at this time.
0 commit comments