Skip to content

Commit

Permalink
use correct this when chaining callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
zlotnika committed Oct 22, 2013
1 parent 35e54c6 commit 0e9fb3d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/orm-timestamps.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ function Plugin(db, opts) {
next();
}

var that = this;
oldHook.call(this, function() {
cont.call(this);
cont.call(that);
});

if(oldHook.length == 0) cont.call(this);
Expand Down Expand Up @@ -68,4 +69,4 @@ function Plugin(db, opts) {
}
};

module.exports = Plugin;
module.exports = Plugin;

0 comments on commit 0e9fb3d

Please sign in to comment.