File tree 3 files changed +4
-7
lines changed
packages/svelte/src/compiler
3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1036,7 +1036,7 @@ const common_visitors = {
1036
1036
// If the same identifiers in the same order are used in another bind:group, they will be in the same group.
1037
1037
// (there's an edge case where `bind:group={a[i]}` will be in a different group than `bind:group={a[j]}` even when i == j,
1038
1038
// but this is a limitation of the current static analysis we do; it also never worked in Svelte 4)
1039
- const bindings = expression_ids . map ( ( id ) => context . state . scope . get ( id . name ) ) ;
1039
+ const bindings = expression_ids . map ( ( id ) => context . state . scope . get ( id . name ) ?? id ) ;
1040
1040
let group_name ;
1041
1041
outer: for ( const [ b , group ] of context . state . analysis . binding_groups ) {
1042
1042
if ( b . length !== bindings . length ) continue ;
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export interface ComponentAnalysis extends Analysis {
68
68
inject_styles : boolean ;
69
69
reactive_statements : Map < LabeledStatement , ReactiveStatement > ;
70
70
/** Identifiers that make up the `bind:group` expression -> internal group binding name */
71
- binding_groups : Map < Array < Binding | null > , Identifier > ;
71
+ binding_groups : Map < Array < Binding | Identifier | null > , Identifier > ;
72
72
slot_names : Set < string > ;
73
73
}
74
74
Original file line number Diff line number Diff line change @@ -108,11 +108,8 @@ export function extract_all_identifiers_from_expression(expr) {
108
108
expr ,
109
109
{ } ,
110
110
{
111
- Identifier ( node , { path } ) {
112
- const parent = path . at ( - 1 ) ;
113
- if ( parent ?. type !== 'MemberExpression' || parent . property !== node || parent . computed ) {
114
- nodes . push ( node ) ;
115
- }
111
+ Identifier ( node ) {
112
+ nodes . push ( node ) ;
116
113
}
117
114
}
118
115
) ;
You can’t perform that action at this time.
0 commit comments