Skip to content

Commit ad723e4

Browse files
authored
Remove IE specific hacks (#477)
We no longer support Internet Explorer.
1 parent 871f5c8 commit ad723e4

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/fake-timers-src.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ if (typeof require === "function" && typeof module === "object") {
143143
* @returns {FakeTimers}
144144
*/
145145
function withGlobal(_global) {
146-
const userAgent = _global.navigator && _global.navigator.userAgent;
147-
const isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1;
148146
const maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint
149147
const idCounterStart = 1e12; // arbitrarily large number to avoid collisions with native timer IDs
150148
const NOOP = function () {
@@ -188,26 +186,6 @@ function withGlobal(_global) {
188186
_global.setImmediate && typeof _global.setImmediate === "function";
189187
const intlPresent = _global.Intl && typeof _global.Intl === "object";
190188

191-
// Make properties writable in IE, as per
192-
// https://www.adequatelygood.com/Replacing-setTimeout-Globally.html
193-
/* eslint-disable no-self-assign */
194-
if (isRunningInIE) {
195-
_global.setTimeout = _global.setTimeout;
196-
_global.clearTimeout = _global.clearTimeout;
197-
_global.setInterval = _global.setInterval;
198-
_global.clearInterval = _global.clearInterval;
199-
_global.Date = _global.Date;
200-
}
201-
202-
// setImmediate is not a standard function
203-
// avoid adding the prop to the window object if not present
204-
if (setImmediatePresent) {
205-
_global.setImmediate = _global.setImmediate;
206-
_global.clearImmediate = _global.clearImmediate;
207-
}
208-
209-
/* eslint-enable no-self-assign */
210-
211189
_global.clearTimeout(timeoutResult);
212190

213191
const NativeDate = _global.Date;

0 commit comments

Comments
 (0)