skip non-writable vars in reactive declaration deps (#2173)

pull/2228/head
Conduitry 6 years ago
parent 863eff9516
commit d91cf4b2ef

@ -1034,7 +1034,10 @@ export default class Component {
if (!assignee_nodes.has(identifier)) { if (!assignee_nodes.has(identifier)) {
const { name } = identifier; const { name } = identifier;
const owner = scope.findOwner(name); const owner = scope.findOwner(name);
if ((!owner || owner === component.instance_scope) && (name[0] === '$' || component.var_lookup.has(name))) { if (
(!owner || owner === component.instance_scope) &&
(name[0] === '$' || component.var_lookup.has(name) && component.var_lookup.get(name).writable)
) {
dependencies.add(name); dependencies.add(name);
} }
} }

Loading…
Cancel
Save