There's a bug in Dirty.prototype.set() where keys are pushed onto _keys, even though they have already been set. This is immediately noticeable when iterating using forEach.
The fix is very simple:
if (!this._keys[key]) { // FAIL - _keys is an Array
this._keys.push(key);
}
should of course be:
if (this._keys.indexOf(key) === -1) { // FIXED
this._keys.push(key);
}
There's a bug in Dirty.prototype.set() where keys are pushed onto _keys, even though they have already been set. This is immediately noticeable when iterating using forEach.
The fix is very simple:
should of course be: