1
0

sinon-ie-1.7.1.js 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. * Sinon.JS 1.7.1, 2013/05/07
  3. *
  4. * @author Christian Johansen (christian@cjohansen.no)
  5. * @author Contributors: https://github.com/cjohansen/Sinon.JS/blob/master/AUTHORS
  6. *
  7. * (The BSD License)
  8. *
  9. * Copyright (c) 2010-2013, Christian Johansen, christian@cjohansen.no
  10. * All rights reserved.
  11. *
  12. * Redistribution and use in source and binary forms, with or without modification,
  13. * are permitted provided that the following conditions are met:
  14. *
  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.
  23. *
  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.
  34. */
  35. /*global sinon, setTimeout, setInterval, clearTimeout, clearInterval, Date*/
  36. /**
  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
  40. * crash.
  41. *
  42. * If you don't require fake timers to work in IE, don't include this file.
  43. *
  44. * @author Christian Johansen (christian@cjohansen.no)
  45. * @license BSD
  46. *
  47. * Copyright (c) 2010-2013 Christian Johansen
  48. */
  49. function setTimeout() {}
  50. function clearTimeout() {}
  51. function setInterval() {}
  52. function clearInterval() {}
  53. function Date() {}
  54. // Reassign the original functions. Now their writable attribute
  55. // should be true. Hackish, I know, but it works.
  56. setTimeout = sinon.timers.setTimeout;
  57. clearTimeout = sinon.timers.clearTimeout;
  58. setInterval = sinon.timers.setInterval;
  59. clearInterval = sinon.timers.clearInterval;
  60. Date = sinon.timers.Date;
  61. /*global sinon*/
  62. /**
  63. * Helps IE run the fake XMLHttpRequest. By defining global functions, IE allows
  64. * them to be overwritten at a later point. If these are not defined like
  65. * this, overwriting them will result in anything from an exception to browser
  66. * crash.
  67. *
  68. * If you don't require fake XHR to work in IE, don't include this file.
  69. *
  70. * @author Christian Johansen (christian@cjohansen.no)
  71. * @license BSD
  72. *
  73. * Copyright (c) 2010-2013 Christian Johansen
  74. */
  75. function XMLHttpRequest() {}
  76. // Reassign the original function. Now its writable attribute
  77. // should be true. Hackish, I know, but it works.
  78. XMLHttpRequest = sinon.xhr.XMLHttpRequest || undefined;