Permalink
Browse files

Fix #18: Chai 1.5 broke our strategy for chainable method asserters.

  • Loading branch information...
domenic committed Feb 9, 2013
1 parent dcea37b commit 3ebd37257eee3a0a2af3fedc8d96a6634a86e901
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/chai-as-promised.js
View
@@ -319,11 +319,14 @@
var args = arguments;
return makeAssertionPromiseToDoAsserter(assertionPromise, baseAssertion, function () {
- return propertyDescriptor.get().apply(assertionPromise, args);
+ // Due to https://github.com/chaijs/chai/commit/514dd6ce466d7b4110b38345e4073d586c017f3f
+ // we can't use `propertyDescriptor.get().apply`.
+ return Function.prototype.apply.call(propertyDescriptor.get(), assertionPromise, args);
});
},
function () {
- return propertyDescriptor.get.call(assertionPromise);
+ // As above.
+ return Function.prototype.call.call(propertyDescriptor.get, assertionPromise);
}
);
} else {

0 comments on commit 3ebd372

Please sign in to comment.