Skip to content

Commit

Permalink
Add clarifying comment for negative indices
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcrouch committed Jan 15, 2020
1 parent 6d59744 commit d851a5e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/sinon/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ var proxyApi = {
getCall: function getCall(index) {
var i = index;
if (i < 0) {
// Negative indices means counting backwards from the last call
i += this.callCount;
}
if (i < 0 || i >= this.callCount) {
Expand Down

0 comments on commit d851a5e

Please sign in to comment.