Skip to content

Commit e056fa2

Browse files
committed
Fixes binding-input-group-each-16 but introduces a failure in binding-input-group-each-12
1 parent 3a104c4 commit e056fa2

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

packages/svelte/src/compiler/phases/2-analyze/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ const common_visitors = {
10361036
// If the same identifiers in the same order are used in another bind:group, they will be in the same group.
10371037
// (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,
10381038
// 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);
10401040
let group_name;
10411041
outer: for (const [b, group] of context.state.analysis.binding_groups) {
10421042
if (b.length !== bindings.length) continue;

packages/svelte/src/compiler/phases/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export interface ComponentAnalysis extends Analysis {
6868
inject_styles: boolean;
6969
reactive_statements: Map<LabeledStatement, ReactiveStatement>;
7070
/** 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>;
7272
slot_names: Set<string>;
7373
}
7474

packages/svelte/src/compiler/utils/ast.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,8 @@ export function extract_all_identifiers_from_expression(expr) {
108108
expr,
109109
{},
110110
{
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);
116113
}
117114
}
118115
);

0 commit comments

Comments
 (0)