From 4c3aa0a36f79047338e2024ae09ff1cb61e38ca9 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sun, 16 Apr 2017 19:59:27 -0400 Subject: [PATCH] prevent component binding blowback on initial render --- .../dom/visitors/Component/Binding.js | 2 +- .../dom/visitors/Element/Binding.js | 2 +- .../dom/visitors/shared/binding/getSetter.js | 21 +++++++++++++----- .../component-binding-blowback/Widget.html | 1 + .../component-binding-blowback/_config.js | 14 ++++++++++++ .../component-binding-blowback/main.html | 22 +++++++++++++++++++ 6 files changed, 54 insertions(+), 8 deletions(-) create mode 100644 test/runtime/samples/component-binding-blowback/Widget.html create mode 100644 test/runtime/samples/component-binding-blowback/_config.js create mode 100644 test/runtime/samples/component-binding-blowback/main.html diff --git a/src/generators/dom/visitors/Component/Binding.js b/src/generators/dom/visitors/Component/Binding.js index 289c796118..c706e755a4 100644 --- a/src/generators/dom/visitors/Component/Binding.js +++ b/src/generators/dom/visitors/Component/Binding.js @@ -35,7 +35,7 @@ export default function visitBinding ( generator, block, state, node, attribute, prop }); - const setter = getSetter({ block, name, keypath, context: '_context', attribute, dependencies, value: 'value' }); + const setter = getSetter({ generator, block, name, keypath, context: '_context', attribute, dependencies, value: 'value' }); generator.hasComplexBindings = true; diff --git a/src/generators/dom/visitors/Element/Binding.js b/src/generators/dom/visitors/Element/Binding.js index c9e2c66cbe..c7da63c32b 100644 --- a/src/generators/dom/visitors/Element/Binding.js +++ b/src/generators/dom/visitors/Element/Binding.js @@ -21,7 +21,7 @@ export default function visitBinding ( generator, block, state, node, attribute const value = getBindingValue( generator, block, state, node, attribute, isMultipleSelect, bindingGroup, type ); const eventName = getBindingEventName( node ); - let setter = getSetter({ block, name, keypath, context: '_svelte', attribute, dependencies, value }); + let setter = getSetter({ generator, block, name, keypath, context: '_svelte', attribute, dependencies, value }); let updateElement; //