File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
packages/svelte/src/compiler/phases/3-transform/client/visitors Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' svelte ' : patch
3+ ---
4+
5+ fix: apply keyed validation only for keyed each
Original file line number Diff line number Diff line change @@ -2279,19 +2279,19 @@ export const template_visitors = {
22792279 )
22802280 : b . literal ( null ) ;
22812281
2282- if ( context . state . options . dev && key_function . type !== 'Literal' ) {
2283- context . state . init . push (
2284- b . stmt ( b . call ( '$.validate_each_keys' , b . thunk ( collection ) , key_function ) )
2285- ) ;
2286- }
2287-
22882282 if ( node . index && each_node_meta . contains_group_binding ) {
22892283 // We needed to create a unique identifier for the index above, but we want to use the
22902284 // original index name in the template, therefore create another binding
22912285 declarations . push ( b . let ( node . index , index ) ) ;
22922286 }
22932287
22942288 if ( ( each_type & EACH_KEYED ) !== 0 ) {
2289+ if ( context . state . options . dev && key_function . type !== 'Literal' ) {
2290+ context . state . init . push (
2291+ b . stmt ( b . call ( '$.validate_each_keys' , b . thunk ( collection ) , key_function ) )
2292+ ) ;
2293+ }
2294+
22952295 context . state . after_update . push (
22962296 b . stmt (
22972297 b . call (
You can’t perform that action at this time.
0 commit comments