diff --git a/src/standard/effectBuilder.html b/src/standard/effectBuilder.html index d8cb0e1487..4048a0ca57 100644 --- a/src/standard/effectBuilder.html +++ b/src/standard/effectBuilder.html @@ -211,6 +211,9 @@ }; // detect literal value (must be String or Number) var fc = arg[0]; + if (fc === '-') { + fc = arg[1]; + } if (fc >= '0' && fc <= '9') { fc = '#'; } @@ -221,7 +224,6 @@ a.literal = true; break; case '#': - case '-': a.value = Number(arg); a.literal = true; break; diff --git a/test/unit/bind-elements.html b/test/unit/bind-elements.html index 388320a6e2..250feae712 100644 --- a/test/unit/bind-elements.html +++ b/test/unit/bind-elements.html @@ -12,6 +12,7 @@ computedattribute$="{{computeInline(value, add,divide)}}" neg-computed-inline="{{!computeInline(value,add,divide)}}" computed-negative-number="{{computeNegativeNumber(-1)}}" + computed-negative-literal="{{computeNegativeNumber(-A)}}" style$="{{boundStyle}}" data-id$="{{dataSetId}}" custom-event-value="{{customEventValue::custom}}" diff --git a/test/unit/bind.html b/test/unit/bind.html index e37478f3bb..3a003841f4 100644 --- a/test/unit/bind.html +++ b/test/unit/bind.html @@ -266,6 +266,10 @@ assert.equal(el.$.boundChild.computedNegativeNumber, -1); }); + test('computed property with negative literal', function() { + assert.equal(el.$.boundChild.computedNegativeLiteral, undefined); + }); + });