Skip to content

Commit 31e6697

Browse files
committedJul 3, 2014
Build: Add "timers_ie.js" file back to the repo
1 parent 41f522a commit 31e6697

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
 

Diff for: ‎external/sinon/timers_ie.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*global sinon, setTimeout, setInterval, clearTimeout, clearInterval, Date*/
2+
/**
3+
* Helps IE run the fake timers. By defining global functions, IE allows
4+
* them to be overwritten at a later point. If these are not defined like
5+
* this, overwriting them will result in anything from an exception to browser
6+
* crash.
7+
*
8+
* If you don't require fake timers to work in IE, don't include this file.
9+
*
10+
* @author Christian Johansen (christian@cjohansen.no)
11+
* @license BSD
12+
*
13+
* Copyright (c) 2010-2013 Christian Johansen
14+
*/
15+
function setTimeout() {}
16+
function clearTimeout() {}
17+
function setImmediate() {}
18+
function clearImmediate() {}
19+
function setInterval() {}
20+
function clearInterval() {}
21+
function Date() {}
22+
23+
// Reassign the original functions. Now their writable attribute
24+
// should be true. Hackish, I know, but it works.
25+
setTimeout = sinon.timers.setTimeout;
26+
clearTimeout = sinon.timers.clearTimeout;
27+
setImmediate = sinon.timers.setImmediate;
28+
clearImmediate = sinon.timers.clearImmediate;
29+
setInterval = sinon.timers.setInterval;
30+
clearInterval = sinon.timers.clearInterval;
31+
Date = sinon.timers.Date;

0 commit comments

Comments
 (0)