diff --git a/lib/sinon/util/fake_server.js b/lib/sinon/util/fake_server.js index 76b9d3fad..100f0ab39 100644 --- a/lib/sinon/util/fake_server.js +++ b/lib/sinon/util/fake_server.js @@ -100,6 +100,9 @@ var fakeServer = { this.xhr = fakeXhr.useFakeXMLHttpRequest(); server.requests = []; server.requestCount = 0; + server.queue = []; + server.responses = []; + this.xhr.onCreate = function (xhrObj) { xhrObj.unsafeHeadersEnabled = function () { @@ -166,10 +169,6 @@ var fakeServer = { handleRequest: function handleRequest(xhr) { if (xhr.async) { - if (!this.queue) { - this.queue = []; - } - push.call(this.queue, xhr); } else { this.processRequest(xhr); @@ -199,10 +198,6 @@ var fakeServer = { return; } - if (!this.responses) { - this.responses = []; - } - if (arguments.length === 1) { body = method; url = method = null;