Skip to content

Commit

Permalink
Remove IE specific hacks (#477)
Browse files Browse the repository at this point in the history
We no longer support Internet Explorer.
  • Loading branch information
fatso83 authored Aug 9, 2023
1 parent 871f5c8 commit ad723e4
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/fake-timers-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ if (typeof require === "function" && typeof module === "object") {
* @returns {FakeTimers}
*/
function withGlobal(_global) {
const userAgent = _global.navigator && _global.navigator.userAgent;
const isRunningInIE = userAgent && userAgent.indexOf("MSIE ") > -1;
const maxTimeout = Math.pow(2, 31) - 1; //see https://heycam.github.io/webidl/#abstract-opdef-converttoint
const idCounterStart = 1e12; // arbitrarily large number to avoid collisions with native timer IDs
const NOOP = function () {
Expand Down Expand Up @@ -188,26 +186,6 @@ function withGlobal(_global) {
_global.setImmediate && typeof _global.setImmediate === "function";
const intlPresent = _global.Intl && typeof _global.Intl === "object";

// Make properties writable in IE, as per
// https://www.adequatelygood.com/Replacing-setTimeout-Globally.html
/* eslint-disable no-self-assign */
if (isRunningInIE) {
_global.setTimeout = _global.setTimeout;
_global.clearTimeout = _global.clearTimeout;
_global.setInterval = _global.setInterval;
_global.clearInterval = _global.clearInterval;
_global.Date = _global.Date;
}

// setImmediate is not a standard function
// avoid adding the prop to the window object if not present
if (setImmediatePresent) {
_global.setImmediate = _global.setImmediate;
_global.clearImmediate = _global.clearImmediate;
}

/* eslint-enable no-self-assign */

_global.clearTimeout(timeoutResult);

const NativeDate = _global.Date;
Expand Down

0 comments on commit ad723e4

Please sign in to comment.