Permalink
Browse files

Build: Add "timers_ie.js" file back to the repo

  • Loading branch information...
markelog committed Jul 3, 2014
1 parent 41f522a commit 31e6697c5856ed1d3d79e457dccbf4a1078cb74b
Showing with 31 additions and 0 deletions.
  1. +31 −0 external/sinon/timers_ie.js
@@ -0,0 +1,31 @@
+/*global sinon, setTimeout, setInterval, clearTimeout, clearInterval, Date*/
+/**
+ * Helps IE run the fake timers. By defining global functions, IE allows
+ * them to be overwritten at a later point. If these are not defined like
+ * this, overwriting them will result in anything from an exception to browser
+ * crash.
+ *
+ * If you don't require fake timers to work in IE, don't include this file.
+ *
+ * @author Christian Johansen (christian@cjohansen.no)
+ * @license BSD
+ *
+ * Copyright (c) 2010-2013 Christian Johansen
+ */
+function setTimeout() {}
+function clearTimeout() {}
+function setImmediate() {}
+function clearImmediate() {}
+function setInterval() {}
+function clearInterval() {}
+function Date() {}
+
+// Reassign the original functions. Now their writable attribute
+// should be true. Hackish, I know, but it works.
+setTimeout = sinon.timers.setTimeout;
+clearTimeout = sinon.timers.clearTimeout;
+setImmediate = sinon.timers.setImmediate;
+clearImmediate = sinon.timers.clearImmediate;
+setInterval = sinon.timers.setInterval;
+clearInterval = sinon.timers.clearInterval;
+Date = sinon.timers.Date;

4 comments on commit 31e6697

@markelog

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Jul 3, 2014

Member

@dmethvin, @mzgol Told you it wasn't the raf stuff :-)

Member

markelog replied Jul 3, 2014

@dmethvin, @mzgol Told you it wasn't the raf stuff :-)

@dmethvin

This comment has been minimized.

Show comment
Hide comment
@dmethvin

dmethvin Jul 3, 2014

Member

That would have broken it for sure 😸

Member

dmethvin replied Jul 3, 2014

That would have broken it for sure 😸

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Jul 3, 2014

Member

Wow, how did it disappear? The bowercopy task should handle it.

Member

mgol replied Jul 3, 2014

Wow, how did it disappear? The bowercopy task should handle it.

@timmywil

This comment has been minimized.

Show comment
Hide comment
@timmywil

timmywil Jul 3, 2014

Member

Woops, my fault. I guess I forgot to run bowercopy when I cherry-picked Scott's commit to move everything to the external directory. timers_ie.js isn't something we have on master.

Member

timmywil replied Jul 3, 2014

Woops, my fault. I guess I forgot to run bowercopy when I cherry-picked Scott's commit to move everything to the external directory. timers_ie.js isn't something we have on master.

Please sign in to comment.