Skip to content

Commit

Permalink
fix: only copy own properties in clone()
Browse files Browse the repository at this point in the history
Fix #7
  • Loading branch information
vkarpov15 committed Dec 9, 2016
1 parent e0cb1cb commit dfe28ce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Expand Up @@ -300,9 +300,15 @@ Kareem.prototype.post = function(name, fn) {
Kareem.prototype.clone = function() {
var n = new Kareem();
for (var key in this._pres) {
if (!this._pres.hasOwnProperty(key)) {
continue;
}
n._pres[key] = this._pres[key].slice();
}
for (var key in this._posts) {
if (!this._pres.hasOwnProperty(key)) {
continue;
}
n._posts[key] = this._posts[key].slice();
}

Expand Down

0 comments on commit dfe28ce

Please sign in to comment.