From d851a5ed367faadb97a410a017f14097f986e277 Mon Sep 17 00:00:00 2001 From: RealZogger <49367953+RealZogger@users.noreply.github.com> Date: Wed, 15 Jan 2020 22:17:14 +0000 Subject: [PATCH] Add clarifying comment for negative indices --- lib/sinon/proxy.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/sinon/proxy.js b/lib/sinon/proxy.js index 28e7e86d3..7b7807aad 100644 --- a/lib/sinon/proxy.js +++ b/lib/sinon/proxy.js @@ -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) {