Skip to content

Commit 4166af2

Browse files
authored
Build: Fix tests in IE 10 & 9, ensure ES5 in tests
1. Change `const`s in `core.js` tests to a `var` to avoid crashes in IE 9 & 10. 2. Modify the ESLint config to require ES5 in tests. Closes gh-532
1 parent 95d05ce commit 4166af2

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

eslint.config.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ export default [
8989
{
9090
files: [ "test/unit/**" ],
9191
languageOptions: {
92-
ecmaVersion: 2015,
92+
ecmaVersion: 5,
9393
sourceType: "script",
9494
globals: {
9595
...globals.browser,
96+
Promise: false,
97+
Symbol: false,
9698
jQuery: false,
9799
QUnit: false,
98100
url: false,
@@ -117,10 +119,12 @@ export default [
117119
files: [ "test/data/**" ],
118120
ignores: [ "test/data/jquery-*.js", "test/data/qunit-start.js" ],
119121
languageOptions: {
120-
ecmaVersion: 2015,
122+
ecmaVersion: 5,
121123
sourceType: "script",
122124
globals: {
123125
...globals.browser,
126+
Promise: false,
127+
Symbol: false,
124128
global: false,
125129
jQuery: false,
126130
QUnit: false,

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/unit/jquery/core.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,8 @@ QUnit[ jQueryVersionSince( "4.0.0" ) ? "test" : "skip" ]( "jQuery.fn.sort", func
477477
var elem = jQuery( "<span></span><div></div><p></p>" );
478478

479479
elem.sort( function( node1, node2 ) {
480-
const tag1 = node1.tagName.toLowerCase();
481-
const tag2 = node2.tagName.toLowerCase();
480+
var tag1 = node1.tagName.toLowerCase(),
481+
tag2 = node2.tagName.toLowerCase();
482482
if ( tag1 < tag2 ) {
483483
return -1;
484484
}

0 commit comments

Comments
 (0)