2 * Sinon.JS 1.15.4, 2015/06/27
4 * @author Christian Johansen (christian@cjohansen.no)
5 * @author Contributors: https://github.com/cjohansen/Sinon.JS/blob/master/AUTHORS
9 * Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no
10 * All rights reserved.
12 * Redistribution and use in source and binary forms, with or without modification,
13 * are permitted provided that the following conditions are met:
15 * * Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * * Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * * Neither the name of Christian Johansen nor the names of his contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 * Helps IE run the fake timers. By defining global functions, IE allows
38 * them to be overwritten at a later point. If these are not defined like
39 * this, overwriting them will result in anything from an exception to browser
42 * If you don't require fake timers to work in IE, don't include this file.
44 * @author Christian Johansen (christian@cjohansen.no)
47 * Copyright (c) 2010-2013 Christian Johansen
49 if (typeof window !== "undefined") {
50 function setTimeout() {}
51 function clearTimeout() {}
52 function setImmediate() {}
53 function clearImmediate() {}
54 function setInterval() {}
55 function clearInterval() {}
58 // Reassign the original functions. Now their writable attribute
59 // should be true. Hackish, I know, but it works.
60 setTimeout = sinon.timers.setTimeout;
61 clearTimeout = sinon.timers.clearTimeout;
62 setImmediate = sinon.timers.setImmediate;
63 clearImmediate = sinon.timers.clearImmediate;
64 setInterval = sinon.timers.setInterval;
65 clearInterval = sinon.timers.clearInterval;
66 Date = sinon.timers.Date;
70 * Helps IE run the fake XMLHttpRequest. By defining global functions, IE allows
71 * them to be overwritten at a later point. If these are not defined like
72 * this, overwriting them will result in anything from an exception to browser
75 * If you don't require fake XHR to work in IE, don't include this file.
77 * @author Christian Johansen (christian@cjohansen.no)
80 * Copyright (c) 2010-2013 Christian Johansen
82 if (typeof window !== "undefined") {
83 function XMLHttpRequest() {}
85 // Reassign the original function. Now its writable attribute
86 // should be true. Hackish, I know, but it works.
87 XMLHttpRequest = sinon.xhr.XMLHttpRequest || undefined;
90 * Helps IE run the fake XDomainRequest. By defining global functions, IE allows
91 * them to be overwritten at a later point. If these are not defined like
92 * this, overwriting them will result in anything from an exception to browser
95 * If you don't require fake XDR to work in IE, don't include this file.
97 if (typeof window !== "undefined") {
98 function XDomainRequest() {}
100 // Reassign the original function. Now its writable attribute
101 // should be true. Hackish, I know, but it works.
102 XDomainRequest = sinon.xdr.XDomainRequest || undefined;