Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:kriskowal/q

  • Loading branch information...
commit 1048107494198611c0c6c2308af56a4015ad318d 2 parents 614cd90 + 63a7afa
@kriskowal authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 q.js
View
10 q.js
@@ -1389,8 +1389,14 @@ function ncall(callback, thisp /*, ...args*/) {
exports.nbind = nbind;
function nbind(callback /* thisp, ...args*/) {
if (arguments.length > 1) {
- var args = array_slice(arguments, 1);
- callback = callback.bind.apply(callback, args);
+ var thisp = arguments[1];
+ var args = array_slice(arguments, 2);
+
+ var originalCallback = callback;
+ callback = function () {
+ var combinedArgs = args.concat(array_slice(arguments));
+ return originalCallback.apply(thisp, combinedArgs);
+ };
}
return function () {
var deferred = defer();
Please sign in to comment.
Something went wrong with that request. Please try again.