diff --git a/src/generators/dom/visitors/Component/Binding.js b/src/generators/dom/visitors/Component/Binding.js index 289c79611835..f4b86425ecf1 100644 --- a/src/generators/dom/visitors/Component/Binding.js +++ b/src/generators/dom/visitors/Component/Binding.js @@ -51,7 +51,7 @@ export default function visitBinding ( generator, block, state, node, attribute, ${updating} = true; ${setter} ${updating} = false; - }); + }, { init: ${generator.helper( 'differs' )}( ${local.name}.get( '${attribute.name}' ), ${snippet} ) }); }); ` ); diff --git a/test/runtime/samples/component-binding-blowback/Widget.html b/test/runtime/samples/component-binding-blowback/Widget.html new file mode 100644 index 000000000000..e88ac68005a5 --- /dev/null +++ b/test/runtime/samples/component-binding-blowback/Widget.html @@ -0,0 +1 @@ +
does nothing
\ No newline at end of file diff --git a/test/runtime/samples/component-binding-blowback/_config.js b/test/runtime/samples/component-binding-blowback/_config.js new file mode 100644 index 000000000000..53d1a9e3d714 --- /dev/null +++ b/test/runtime/samples/component-binding-blowback/_config.js @@ -0,0 +1,14 @@ +export default { + test ( assert, component ) { + let count = 0; + + component.observe( 'bar', () => { + count += 1; + }); + + component.set({ x: true }); + assert.equal( count, 1 ); + + component.destroy(); + } +}; diff --git a/test/runtime/samples/component-binding-blowback/main.html b/test/runtime/samples/component-binding-blowback/main.html new file mode 100644 index 000000000000..e028fe32abb9 --- /dev/null +++ b/test/runtime/samples/component-binding-blowback/main.html @@ -0,0 +1,22 @@ +{{#if x}} +blah, bar, baz
` ); - + component.destroy(); } };