From 400cd1d1eae01c7bd56d60c46a7fda178035783b Mon Sep 17 00:00:00 2001 From: Conduitry Date: Sun, 23 Feb 2020 10:16:32 -0500 Subject: [PATCH] deconflict 'value' param in contextual bindings (#4445) --- .../render_dom/wrappers/InlineComponent/index.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts b/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts index f1c57ed094..1532539b7d 100644 --- a/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts +++ b/src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts @@ -332,8 +332,7 @@ export default class InlineComponentWrapper extends Wrapper { contextual_dependencies.push(object.name, property.name); } - const value = block.get_unique_name('value'); - const params: any[] = [value]; + const params: any[] = [x`#value`]; if (contextual_dependencies.length > 0) { const args = []; @@ -349,23 +348,23 @@ export default class InlineComponentWrapper extends Wrapper { block.chunks.init.push(b` - function ${id}(${value}) { - ${callee}.call(null, ${value}, ${args}); + function ${id}(#value) { + ${callee}.call(null, #value, ${args}); } `); block.maintain_context = true; // TODO put this somewhere more logical } else { block.chunks.init.push(b` - function ${id}(${value}) { - ${callee}.call(null, ${value}); + function ${id}(#value) { + ${callee}.call(null, #value); } `); } const body = b` function ${id}(${params}) { - ${lhs} = ${value}; + ${lhs} = #value; ${renderer.invalidate(dependencies[0])}; } `;