diff --git a/hooks.js b/hooks.js index f7fd0fc..00735f7 100644 --- a/hooks.js +++ b/hooks.js @@ -22,7 +22,7 @@ module.exports = { proto[name] = function () { var self = this - , hookArgs // arguments eventually passed to the hook - are mutable + , hookArgs = []// arguments eventually passed to the hook - are mutable , lastArg = arguments[arguments.length-1] , pres = this._pres[name] , posts = this._posts[name] @@ -38,6 +38,7 @@ module.exports = { , preArgs; if (_args.length && !(arguments[0] == null && typeof lastArg === 'function')) hookArgs = _args; + if (++_current < _total) { currPre = pres[_current] if (currPre.isAsync && currPre.length < 2) diff --git a/package.json b/package.json index a2d4a36..dcd5cf5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "hooks", "description": "Adds pre and post hook functionality to your JavaScript methods.", - "version": "0.3.0", + "version": "0.3.1", "keywords": [ "node", "hooks",