From: Timo Tijhof Date: Thu, 10 Jul 2014 13:36:30 +0000 (+0200) Subject: Backport SinonJS bugfix for broken splice() in IE8 and es5-shim X-Git-Tag: 1.31.0-rc.0~15016 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=dcdca4944dec1228b6ca38955298c8a541f01378;p=lhc%2Fweb%2Fwiklou.git Backport SinonJS bugfix for broken splice() in IE8 and es5-shim SinonJS 1.9.1 made use of a rare feature in Array#splice that is implemented in most browsers but not actually part of the ES5 spec. And in IE8 and es5-shimmed environments, the method was 'broken' and thus always yielded an empty array causing none of the XHRs to be responded to. We can't upgrade to SinonJS 1.10 right now due to https://github.com/cjohansen/Sinon.JS/issues/506. Patch source: https://github.com/cjohansen/Sinon.JS/commit/60ab124d21 Change-Id: I8882198b1609cb78f16a8269d40bb19df2df127a --- diff --git a/resources/lib/sinonjs/sinon-1.9.0.js b/resources/lib/sinonjs/sinon-1.9.0.js index 428b729b64..574e617ae7 100644 --- a/resources/lib/sinonjs/sinon-1.9.0.js +++ b/resources/lib/sinonjs/sinon-1.9.0.js @@ -4152,7 +4152,7 @@ sinon.fakeServer = (function () { respond: function respond() { if (arguments.length > 0) this.respondWith.apply(this, arguments); var queue = this.queue || []; - var requests = queue.splice(0); + var requests = queue.splice(0, queue.length); var request; while(request = requests.shift()) {