diff --git a/index.js b/index.js index b2b272c..cd99473 100644 --- a/index.js +++ b/index.js @@ -19,12 +19,12 @@ module.exports = thunkify; * @api public */ -function thunkify(fn){ +function thunkify(fn,scope){ assert('function' == typeof fn, 'function required'); return function(){ var args = new Array(arguments.length); - var ctx = this; + var ctx = scope || this; for(var i = 0; i < args.length; ++i) { args[i] = arguments[i];