pull/3539/head
Richard Harris 6 years ago
parent 79b75cfbb0
commit 36b0bd32be

@ -30,8 +30,7 @@ export function invalidate(component: Component, scope: Scope, node: Node, names
if (node.type === 'AssignmentExpression' && node.operator === '=' && nodes_match(node.left, node.right) && tail.length === 0) { if (node.type === 'AssignmentExpression' && node.operator === '=' && nodes_match(node.left, node.right) && tail.length === 0) {
return component.invalidate(head); return component.invalidate(head);
} else { } else {
let callee = head[0] === '$' ? `@set_store_value` : `$$invalidate`; const is_store_value = head[0] === '$';
const variable = component.var_lookup.get(head); const variable = component.var_lookup.get(head);
const extra_args = tail.map(name => component.invalidate(name)); const extra_args = tail.map(name => component.invalidate(name));
@ -49,7 +48,8 @@ export function invalidate(component: Component, scope: Scope, node: Node, names
}); });
} }
let invalidate = x`${callee}("${head}", ${node}, ${extra_args})`; const callee = is_store_value ? `@set_store_value` : `$$invalidate`;
let invalidate = x`${callee}(${is_store_value ? head.slice(1) : x`"${head}"`}, ${node}, ${extra_args})`;
if (variable.subscribable && variable.reassigned) { if (variable.subscribable && variable.reassigned) {
const subscribe = `$$subscribe_${head}`; const subscribe = `$$subscribe_${head}`;

Loading…
Cancel
Save