From 36b0bd32bedcc66123c85b544a0c3b1135065698 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Wed, 18 Sep 2019 21:14:18 -0400 Subject: [PATCH] fix --- src/compiler/compile/utils/invalidate.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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}`;