Merge pull request #4429 from fredj/object_change_evt

Dispatch a change event only if the value changes
This commit is contained in:
Frédéric Junod
2015-11-17 12:51:26 +01:00
2 changed files with 10 additions and 1 deletions

View File

@@ -168,6 +168,13 @@ describe('ol.Object', function() {
expect(event.key).to.be('k');
});
it('dispatches events only if the value is different', function() {
o.set('k', 1);
o.set('k', 1);
expect(listener1.calledOnce).to.be(true);
expect(listener2.calledOnce).to.be(true);
});
});
describe('setter', function() {