diff --git a/src/compiler/compile/utils/invalidate.ts b/src/compiler/compile/utils/invalidate.ts index ab08e8e444..f386991d04 100644 --- a/src/compiler/compile/utils/invalidate.ts +++ b/src/compiler/compile/utils/invalidate.ts @@ -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) { return component.invalidate(head); } else { - let callee = head[0] === '$' ? `@set_store_value` : `$$invalidate`; - + const is_store_value = head[0] === '$'; const variable = component.var_lookup.get(head); 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) { const subscribe = `$$subscribe_${head}`;