fix: avoid double loop

bindable-not-updated
paoloricciuti 7 months ago
parent 9276b38dd9
commit 8dea7d1c52

@ -764,16 +764,12 @@ export function analyze_component(root, source, options) {
w.non_reactive_update(binding.node, name); w.non_reactive_update(binding.node, name);
continue outer; continue outer;
} }
} else if (binding.kind === 'bindable_prop' && !binding.updated) {
// this check only applies to instance but we check here to avoid a second loop
w.bindable_prop_not_mutated(binding.node, name);
} }
} }
} }
// warn on bindable props that are never mutated or reassigned
for (const [name, binding] of instance.scope.declarations) {
if (binding.kind === 'bindable_prop' && !binding.updated) {
w.bindable_prop_not_mutated(binding.node, name);
}
}
} else { } else {
instance.scope.declare(b.id('$$props'), 'rest_prop', 'synthetic'); instance.scope.declare(b.id('$$props'), 'rest_prop', 'synthetic');
instance.scope.declare(b.id('$$restProps'), 'rest_prop', 'synthetic'); instance.scope.declare(b.id('$$restProps'), 'rest_prop', 'synthetic');

Loading…
Cancel
Save