File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
packages/svelte/src/compiler/phases/3-transform/client/visitors Expand file tree Collapse file tree 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 @@ -2383,17 +2383,16 @@ export const template_visitors = {
23832383 /** @type {import('estree').BlockStatement } */ ( context . visit ( node . fallback ) )
23842384 )
23852385 : b . literal ( null ) ;
2386- const key_function =
2387- node . key && ( ( each_type & EACH_ITEM_REACTIVE ) !== 0 || context . state . options . dev )
2388- ? b . arrow (
2389- [ node . context . type === 'Identifier' ? node . context : b . id ( '$$item' ) , index ] ,
2390- b . block (
2391- declarations . concat (
2392- b . return ( /** @type {import('estree').Expression } */ ( context . visit ( node . key ) ) )
2393- )
2386+ const key_function = node . key
2387+ ? b . arrow (
2388+ [ node . context . type === 'Identifier' ? node . context : b . id ( '$$item' ) , index ] ,
2389+ b . block (
2390+ declarations . concat (
2391+ b . return ( /** @type {import('estree').Expression } */ ( context . visit ( node . key ) ) )
23942392 )
23952393 )
2396- : b . literal ( null ) ;
2394+ )
2395+ : b . literal ( null ) ;
23972396
23982397 if ( node . index && each_node_meta . contains_group_binding ) {
23992398 // 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