Skip to content

Commit

Permalink
forEach() requires 'this' argument
Browse files Browse the repository at this point in the history
Otherwise, this is evaluated to undefined, which causes cryptic errors like:

`Cannot read property 'method' of undefined`

instead of:

`writeFileSync received wrong arguments(...)`
  • Loading branch information
hrimhari authored Mar 22, 2017
1 parent f701abe commit 917ac62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sinon/mock-expectation.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ var mockExpectation = {
mockExpectation.fail(this.method + " received wrong arguments " + format(args) +
", expected " + format(expectedArguments));
}
});
}, this);
},

allowsCall: function allowsCall(thisValue, args) {
Expand Down

0 comments on commit 917ac62

Please sign in to comment.