Permalink
Browse files

A `Function#bind` usage slipped by.

Compare with GH-7. Should help with GH-8.
1 parent eeb0c1a commit 6e582e9bb14ac5c3c75fcd1d9465cd3c44ad944f @domenic committed Apr 17, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/sinon-chai.js
View
@@ -56,7 +56,10 @@
function getMessages(spy, action, nonNegatedSuffix, always, args) {
var verbPhrase = always ? "always have " : "have ";
nonNegatedSuffix = nonNegatedSuffix || "";
- var printfArray = Function.prototype.apply.bind(spy.printf, spy);
+
+ function printfArray(array) {
+ return spy.printf.apply(spy, array);
+ }
return {
affirmative: printfArray(["expected %n to " + verbPhrase + action + nonNegatedSuffix].concat(args)),

0 comments on commit 6e582e9

Please sign in to comment.