Skip to content

Commit

Permalink
Merge pull request #1528 from Polymer/0.8-negate-annotated-computation
Browse files Browse the repository at this point in the history
0.8 negate annotated computation
  • Loading branch information
kevinpschaaf committed May 14, 2015
2 parents 95cc9c9 + 2efcb60 commit 266f2c9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/lib/bind/effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
var computedHost = this._rootDataHost || this;
var computedvalue =
computedHost[effect.method].apply(computedHost, args);
if (effect.negate) {
computedvalue = !computedvalue;
}
this._applyEffectValue(computedvalue, effect);
}
},
Expand Down
3 changes: 2 additions & 1 deletion src/standard/effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@
args: sig.args,
arg: arg,
property: note.name,
index: index
index: index,
negate: note.negate
});
}, this);
},
Expand Down
1 change: 1 addition & 0 deletions test/unit/bind-elements.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
computed-inline="{{computeInline(value,add, divide)}}"
computed-inline2="{{computeInline(value, add,divide)}}"
computedattribute$="{{computeInline(value, add,divide)}}"
neg-computed-inline="{{!computeInline(value,add,divide)}}"
style$="{{boundStyle}}"
data-id$="{{dataSetId}}"
custom-event-value="{{customEventValue::custom}}"
Expand Down
1 change: 1 addition & 0 deletions test/unit/bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
el.divide = 3;
assert.equal(el.$.boundChild.computedInline, 20, 'computedInline not correct');
assert.equal(el.$.boundChild.computedInline2, 20, 'computedInline2 not correct');
assert.equal(el.$.boundChild.negComputedInline, false, 'negComputedInline not correct');
});

test('annotated computed attribute', function() {
Expand Down

0 comments on commit 266f2c9

Please sign in to comment.