Skip to content

Commit

Permalink
Core: Remove support for IE 9 and IE 10
Browse files Browse the repository at this point in the history
Closes #1725.
  • Loading branch information
Krinkle committed May 29, 2024
1 parent 038cd46 commit ae3ad1f
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"no-console": "error",
"compat/compat": [
"error",
"android >= 4.3, firefox >= 45, ie >= 9, safari >= 9.1, ios_saf >= 7, chrome >= 58"
"android >= 4.3, firefox >= 45, ie >= 11, safari >= 9.1, ios_saf >= 7, chrome >= 58"
]
}
},
Expand Down
2 changes: 0 additions & 2 deletions build/browserstack-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
"firefox_78",
"firefox_previous",
"firefox_current",
"ie_9",
"ie_10",
"ie_11",
"edge_15",
"edge_18",
Expand Down
2 changes: 1 addition & 1 deletion build/browserstack-quick.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"browsers": [
"firefox_45",
"firefox_current",
"ie_9",
"ie_11",
"safari_9.1",
"safari_current",
"opera_current",
Expand Down
6 changes: 3 additions & 3 deletions src/core/stacktrace.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Doesn't support IE9, it will return undefined on these browsers
// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack
const fileName = (sourceFromStacktrace(0) || '')
.replace(/(:\d+)+\)?/, '')
Expand Down Expand Up @@ -33,8 +32,9 @@ export function extractStacktrace (e, offset) {
export function sourceFromStacktrace (offset) {
let error = new Error();

// Support: Safari <=7 only, IE <=10 - 11 only
// Not all browsers generate the `stack` property for `new Error()`, see also #636
// Support: Safari <=7, IE 11
// Not all browsers generate the `stack` property for `new Error()`
// See also https://github.com/qunitjs/qunit/issues/636
if (!error.stack) {
try {
throw error;
Expand Down
2 changes: 1 addition & 1 deletion src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const localSessionStorage = (function () {
}());

// Basic fallback for ES6 Map
// Support: IE 9-10, Safari 7, PhantomJS; Map is undefined
// Support: Safari 7, PhantomJS; Map is undefined
// Support: iOS 8; `new Map(iterable)` is not supported
//
// Fallback for ES7 Map#keys
Expand Down
10 changes: 1 addition & 9 deletions src/logger.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import { console } from './globals';

// Support: IE 9
// Detect if the console object exists and no-op otherwise.
// This allows support for IE 9, which doesn't have a console
// object if the developer tools are not open.

// Support: IE 9
// Function#bind is supported, but no console.log.bind().

// Support: SpiderMonkey (mozjs 68+)
// The console object has a log method, but no warn method.

export default {
warn: console
? Function.prototype.bind.call(console.warn || console.log, console)
? (console.warn || console.log).bind(console)
: function () {}
};
3 changes: 1 addition & 2 deletions src/reporters/ConsoleReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export default class ConsoleReporter {
// Cache references to console methods to ensure we can report failures
// from tests tests that mock the console object itself.
// https://github.com/qunitjs/qunit/issues/1340
// Support IE 9: Function#bind is supported, but no console.log.bind().
this.log = options.log || Function.prototype.bind.call(console.log, console);
this.log = options.log || console.log.bind(console);

runner.on('error', this.onError.bind(this));
runner.on('runStart', this.onRunStart.bind(this));
Expand Down
7 changes: 3 additions & 4 deletions src/reporters/TapReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function prettyYamlValue (value, indent = 4) {
value = String(value);
}

// Support IE 9-11: Use isFinite instead of ES6 Number.isFinite
// Support IE 11: Use isFinite instead of ES6 Number.isFinite
if (typeof value === 'number' && !isFinite(value)) {
// Turn NaN and Infinity into simple strings.
// Paranoia: Don't return directly just in case there's
Expand Down Expand Up @@ -93,7 +93,7 @@ function prettyYamlValue (value, indent = 4) {
}

// See also <https://yaml-multiline.info/>
// Support IE 9-11: Avoid ES6 String#repeat
// Support IE 11: Avoid ES6 String#repeat
const prefix = (new Array(indent + 1)).join(' ');

const trailingLinebreakMatch = value.match(/\n+$/);
Expand Down Expand Up @@ -174,8 +174,7 @@ export default class TapReporter {
// Cache references to console methods to ensure we can report failures
// from tests tests that mock the console object itself.
// https://github.com/qunitjs/qunit/issues/1340
// Support IE 9: Function#bind is supported, but no console.log.bind().
this.log = options.log || Function.prototype.bind.call(console.log, console);
this.log = options.log || console.log.bind(console);

this.testCount = 0;
this.ended = false;
Expand Down
13 changes: 0 additions & 13 deletions test/main/assert.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function buildMockPromise (settledValue, shouldFulfill) {
// Support IE 9: Promise not supported, test MUST NOT load polyfil globally.
// Support SpiderMonkey: setTimeout is not supported, but native Promise is.
var defer = typeof setTimeout !== 'undefined'
// eslint-disable-next-line no-undef
Expand Down Expand Up @@ -362,8 +361,6 @@ QUnit.test('throws', function (assert) {
);
}, /^Error: assert\.throws does not accept a string value for the expected argument/);

// This test is for IE 7 and prior which does not properly
// implement Error.prototype.toString
assert.throws(
function () {
throw new Error('error message');
Expand Down Expand Up @@ -396,10 +393,6 @@ QUnit.test('throws', function (assert) {
'thrown TypeError with a message is an instance of Error'
);

// This test is for IE 8 and prior which goes against the standards
// by considering that the native Error constructors, such TypeError,
// are also instances of the Error constructor. As such, the assertion
// sometimes went down the wrong path.
assert.throws(
function () {
throw new TypeError('error message');
Expand Down Expand Up @@ -604,8 +597,6 @@ QUnit.test('rejects', function (assert) {
"simple string rejection, no 'expected' value given"
);

// This test is for IE 7 and prior which does not properly
// implement Error.prototype.toString
assert.rejects(
buildMockPromise(new Error('error message')),
/error message/,
Expand All @@ -630,10 +621,6 @@ QUnit.test('rejects', function (assert) {
'thrown TypeError with a message is an instance of Error'
);

// This test is for IE 8 and prior which goes against the standards
// by considering that the native Error constructors, such TypeError,
// are also instances of the Error constructor. As such, the assertion
// sometimes went down the wrong path.
assert.rejects(
buildMockPromise(new TypeError('error message')),
TypeError,
Expand Down
1 change: 0 additions & 1 deletion test/main/promise.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Support IE 9: Promise not supported, test MUST NOT load polyfil globally.
// Support SpiderMonkey: setTimeout is not supported, but native Promise is.
var defer = typeof setTimeout !== 'undefined'
// eslint-disable-next-line no-undef
Expand Down
6 changes: 1 addition & 5 deletions test/webWorker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/* eslint-env browser */
QUnit.module('Web Worker');

// Support: IE 9
/* eslint-disable compat/compat */
var testMethod = window.Worker ? 'test' : 'skip';

QUnit[testMethod]('main tests', function (assert) {
QUnit.test('main tests', function (assert) {
assert.expect(1);
var done = assert.async();
var worker = new Worker('webWorker-worker.js');
Expand Down

0 comments on commit ae3ad1f

Please sign in to comment.