From 0020afcf92c5191b10c8376f92eda9b6e62f8d9e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 5 Jun 2015 09:47:06 -0400 Subject: [PATCH] feature(util) exec.with: callback.bind -> bind.apply --- lib/util.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/util.js b/lib/util.js index 353f86bc..430e556b 100644 --- a/lib/util.js +++ b/lib/util.js @@ -271,11 +271,13 @@ /* * return function that calls callback with arguments */ - exec.with = function(callback) { - var args = [].slice.call(arguments, 1); + var args = [].slice.call(arguments), + bind = Function.prototype.bind; - return callback.bind(null, args); + args[0] = null; + + return bind.apply(callback, args); }; /**