Skip to content

Commit

Permalink
Fix for changing property to the same value
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed May 24, 2016
1 parent 409ad83 commit 66e6e22
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/bind/accessors.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
var effects = node._propertyEffects && node._propertyEffects[property];
if (effects) {
node._propertySetter(property, value, effects, quiet);
} else {
} else if (node[property] !== value) {
node[property] = value;
}
},
Expand Down
14 changes: 14 additions & 0 deletions test/unit/bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,20 @@
assert.isTrue(el._isAttachedChanged.calledOnce);
document.body.removeChild(el);
});

test('do not override property when going downwards', function() {
var value = 5, value_set_again = false, targetObj = {
get value () {
return value;
},
set value (v) {
value = v;
value_set_again = true;
}
};
Polymer.Bind._modelApi.__setProperty('value', 5, false, targetObj);
assert.isFalse(value_set_again);
});
});

suite('compound binding / string interpolation', function() {
Expand Down

0 comments on commit 66e6e22

Please sign in to comment.