Skip to content

Commit 775c069

Browse files
committed
Core: Remove support for IE 9 and IE 10
Closes #1725.
1 parent 038cd46 commit 775c069

11 files changed

+13
-43
lines changed

.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"no-console": "error",
4242
"compat/compat": [
4343
"error",
44-
"android >= 4.3, firefox >= 45, ie >= 9, safari >= 9.1, ios_saf >= 7, chrome >= 58"
44+
"android >= 4.3, firefox >= 45, ie >= 11, safari >= 9.1, ios_saf >= 7, chrome >= 58"
4545
]
4646
}
4747
},
@@ -60,7 +60,7 @@
6060
"rules": {
6161
"compat/compat": [
6262
"error",
63-
"android >= 4.3, firefox >= 45, ie >= 9, safari >= 9.1, chrome >= 58"
63+
"android >= 4.3, firefox >= 45, ie >= 11, safari >= 9.1, chrome >= 58"
6464
],
6565
"max-len": "off",
6666
"no-throw-literal": "off",

build/browserstack-full.json

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
"firefox_78",
1010
"firefox_previous",
1111
"firefox_current",
12-
"ie_9",
13-
"ie_10",
1412
"ie_11",
1513
"edge_15",
1614
"edge_18",

build/browserstack-quick.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"browsers": [
88
"firefox_45",
99
"firefox_current",
10-
"ie_9",
10+
"ie_11",
1111
"safari_9.1",
1212
"safari_current",
1313
"opera_current",

src/core/stacktrace.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Doesn't support IE9, it will return undefined on these browsers
21
// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack
32
const fileName = (sourceFromStacktrace(0) || '')
43
.replace(/(:\d+)+\)?/, '')
@@ -33,8 +32,9 @@ export function extractStacktrace (e, offset) {
3332
export function sourceFromStacktrace (offset) {
3433
let error = new Error();
3534

36-
// Support: Safari <=7 only, IE <=10 - 11 only
37-
// Not all browsers generate the `stack` property for `new Error()`, see also #636
35+
// Support: Safari <=7, IE 11
36+
// Not all browsers generate the `stack` property for `new Error()`
37+
// See also https://github.com/qunitjs/qunit/issues/636
3838
if (!error.stack) {
3939
try {
4040
throw error;

src/globals.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const localSessionStorage = (function () {
6464
}());
6565

6666
// Basic fallback for ES6 Map
67-
// Support: IE 9-10, Safari 7, PhantomJS; Map is undefined
67+
// Support: Safari 7, PhantomJS; Map is undefined
6868
// Support: iOS 8; `new Map(iterable)` is not supported
6969
//
7070
// Fallback for ES7 Map#keys

src/logger.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
import { console } from './globals';
22

3-
// Support: IE 9
4-
// Detect if the console object exists and no-op otherwise.
5-
// This allows support for IE 9, which doesn't have a console
6-
// object if the developer tools are not open.
7-
8-
// Support: IE 9
9-
// Function#bind is supported, but no console.log.bind().
10-
113
// Support: SpiderMonkey (mozjs 68+)
124
// The console object has a log method, but no warn method.
135

146
export default {
157
warn: console
16-
? Function.prototype.bind.call(console.warn || console.log, console)
8+
? (console.warn || console.log).bind(console)
179
: function () {}
1810
};

src/reporters/ConsoleReporter.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ export default class ConsoleReporter {
55
// Cache references to console methods to ensure we can report failures
66
// from tests tests that mock the console object itself.
77
// https://github.com/qunitjs/qunit/issues/1340
8-
// Support IE 9: Function#bind is supported, but no console.log.bind().
9-
this.log = options.log || Function.prototype.bind.call(console.log, console);
8+
this.log = options.log || console.log.bind(console);
109

1110
runner.on('error', this.onError.bind(this));
1211
runner.on('runStart', this.onRunStart.bind(this));

src/reporters/TapReporter.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function prettyYamlValue (value, indent = 4) {
4242
value = String(value);
4343
}
4444

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

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

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

180179
this.testCount = 0;
181180
this.ended = false;

test/main/assert.js

-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
function buildMockPromise (settledValue, shouldFulfill) {
2-
// Support IE 9: Promise not supported, test MUST NOT load polyfil globally.
32
// Support SpiderMonkey: setTimeout is not supported, but native Promise is.
43
var defer = typeof setTimeout !== 'undefined'
54
// eslint-disable-next-line no-undef
@@ -362,8 +361,6 @@ QUnit.test('throws', function (assert) {
362361
);
363362
}, /^Error: assert\.throws does not accept a string value for the expected argument/);
364363

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

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

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

633-
// This test is for IE 8 and prior which goes against the standards
634-
// by considering that the native Error constructors, such TypeError,
635-
// are also instances of the Error constructor. As such, the assertion
636-
// sometimes went down the wrong path.
637624
assert.rejects(
638625
buildMockPromise(new TypeError('error message')),
639626
TypeError,

test/main/promise.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Support IE 9: Promise not supported, test MUST NOT load polyfil globally.
21
// Support SpiderMonkey: setTimeout is not supported, but native Promise is.
32
var defer = typeof setTimeout !== 'undefined'
43
// eslint-disable-next-line no-undef

test/webWorker.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/* eslint-env browser */
22
QUnit.module('Web Worker');
33

4-
// Support: IE 9
5-
/* eslint-disable compat/compat */
6-
var testMethod = window.Worker ? 'test' : 'skip';
7-
8-
QUnit[testMethod]('main tests', function (assert) {
4+
QUnit.test('main tests', function (assert) {
95
assert.expect(1);
106
var done = assert.async();
117
var worker = new Worker('webWorker-worker.js');

0 commit comments

Comments
 (0)