diff --git a/lib/mixins/property-effects.html b/lib/mixins/property-effects.html index b33b386b0b..827c6de1a9 100644 --- a/lib/mixins/property-effects.html +++ b/lib/mixins/property-effects.html @@ -2797,4 +2797,4 @@ }; })(); - \ No newline at end of file + diff --git a/lib/mixins/strict-binding-parser.html b/lib/mixins/strict-binding-parser.html index 5b94efe5b9..4e0c24486f 100644 --- a/lib/mixins/strict-binding-parser.html +++ b/lib/mixins/strict-binding-parser.html @@ -280,7 +280,6 @@ storeMethodVariable(bindingData, text, i); storeMethod(bindingData, templateInfo); bindingData.startChar = i + 1; - storeMethod(bindingData, templateInfo); state = STATE.METHODCLOSED; break; } diff --git a/test/unit/property-effects-elements.html b/test/unit/property-effects-elements.html index 969fe19ce9..2e3efbc0b7 100644 --- a/test/unit/property-effects-elements.html +++ b/test/unit/property-effects-elements.html @@ -46,6 +46,7 @@ compoundAttr2$="literal1 {{cpnd1}} literal2 {{cpnd2}}{{cpnd3.prop}} literal3 {{computeCompound(cpnd4, cpnd5, 'literalComputed')}} literal4" compoundAttr3$="[yes/no]: {{cpnd1}}, {{computeCompound('world', 'username ', 'Hello {0} ')}}" computed-from-behavior="{{computeFromBehavior(value)}}" + computed-dynamic-fn="{{dynamicFn('hello', 'username')}}" > Test @@ -82,7 +83,7 @@ content: '[[binding]]' } - [[objectWithSlash.binding/with/slash]] + [[objectWithSlash.binding/with/slash]] [["Jan", 31],["Feb", 28],["Mar", 31]] {{objectWithNonEnglishUnicode.商品名}} foo(field, true): {{computeWithBoolean(otherValue, true)}} @@ -181,6 +182,9 @@ }, title: { observer: 'titleChanged' + }, + dynamicFn: { + type: Function } }, observers: [ @@ -202,6 +206,7 @@ notifierWithoutComputingChanged: 0 }; this.titleChanged = sinon.spy(); + this._dynamicFnCalled = false; }, ready: function() { this.isReady = true; @@ -328,7 +333,8 @@ this.customNotifyingValue = 'changed!'; this.dispatchEvent(new CustomEvent('custom-notifying-value-changed'), {value: this.customNotifyingValue}); - } + }, + dynamicFn: function() {} }); HTMLImports.whenReady(() => { diff --git a/test/unit/property-effects.html b/test/unit/property-effects.html index f0c78ac772..fbb8ac7fbe 100644 --- a/test/unit/property-effects.html +++ b/test/unit/property-effects.html @@ -409,6 +409,13 @@ } }); + test('only calls dynamic functions once', function() { + el.dynamicFn = function() { + assert.isFalse(this._dynamicFnCalled); + this._dynamicFnCalled = true; + }; + }); + suite('observer inheritance', function() { setup(function() { el = document.createElement('sub-observer-element');