Improve compiler output on legacy components to prevent infinite loops from <select> bind:value on $: derived variables

pull/16165/head
raythurnvoid 3 months ago
parent 546608636a
commit d3fe49548a

@ -414,6 +414,16 @@ function setup_select_synchronization(value_binding, context) {
bound = /** @type {Identifier | MemberExpression} */ (bound.object);
}
// guard against reactively-derived bindings to prevent circular dependencies
if (bound.type === 'Identifier') {
const binding = context.state.scope.get(bound.name);
if (binding && binding.kind === 'legacy_reactive') {
// skip synchronization for reactive-derived bindings,
// the reactive statement already handles updates properly
return;
}
}
/** @type {string[]} */
const names = [];

Loading…
Cancel
Save