8000 Lint:fix the polyfill script file · ulyssear/css-in-js-in-html@dd193fc · GitHub
[go: up one dir, main page]

Skip to content

Commit dd193fc

Browse files
committed
Lint:fix the polyfill script file
1 parent 472a23b commit dd193fc

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/polyfill.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if (!window.getComputedStyle) {
55
(this.getPropertyValue = function (t) {
66
var n = /(\-([a-z]){1})/g;
77
return (
8-
t == 'float' && (t = 'styleFloat'),
8+
t === 'float' && (t = 'styleFloat'),
99
n.test(t) &&
1010
(t = t.replace(n, function () {
1111
return arguments[2].toUpperCase();
@@ -32,20 +32,20 @@ if (!Array.prototype.lastIndexOf) {
3232
throw new TypeError();
3333
}
3434

35-
var n,
36-
k,
37-
t = Object(this),
38-
len = t.length >>> 0;
35+
var n;
36+
var k;
37+
var t = Object(this);
38+
var len = t.length >>> 0;
3939
if (len === 0) {
4040
return -1;
4141
}
4242

4343
n = len - 1;
4444
if (arguments.length > 1) {
4545
n = Number(arguments[1]);
46-
if (n != n) {
46+
if (n !== n) {
4747
n = 0;
48-
} else if (n != 0 && n != 1 / 0 && n != -(1 / 0)) {
48+
} else if (n !== 0 && n !== 1 / 0 && n !== -(1 / 0)) {
4949
n = (n > 0 || -1) * Math.floor(Math.abs(n));
5050
}
5151
}
@@ -83,7 +83,7 @@ if (!Array.prototype.reduce) {
8383
};
8484
}
8585
function addEvent(on, fn, self) {
86-
return (self = this).attachEvent('on' + on, function (e) {
86+
return (self = this).attachEvent(`on${on}`, function (e) {
8787
var e = e || win.event;
8888
e.preventDefault =
8989
e.preventDefault ||
@@ -126,9 +126,9 @@ window.matchMedia ||
126126
var styleMedia = window.styleMedia || window.media;
127127

128128
if (!styleMedia) {
129-
var style = document.createElement('style'),
130-
script = document.getElementsByTagName('script')[0],
131-
info = null;
129+
var style = document.createElement('style');
130+
var script = document.getElementsByTagName('script')[0];
131+
var info = null;
132132

133133
style.type = 'text/css';
134134
style.id = 'matchmediajs-test';
@@ -143,7 +143,7 @@ window.matchMedia ||
143143

144144
styleMedia = {
145145
matchMedium: function (media) {
146-
var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
146+
var text = `@media ${media}{ #matchmediajs-test { width: 1px; } }`;
147147

148148
if (style.styleSheet) {
149149
style.styleSheet.cssText = text;
@@ -166,13 +166,13 @@ window.matchMedia ||
166166

167167
if (!document.querySelectorAll) {
168168
document.querySelectorAll = function (selectors) {
169-
var style = document.createElement('style'),
170-
elements = [],
171-
element;
169+
var style = document.createElement('style');
170+
var elements = [];
171+
var element;
172172
document.documentElement.firstChild.appendChild(style);
173173
document._qsa = [];
174174

175-
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
175+
style.styleSheet.cssText = `${selectors}{x-qsa:expression(document._qsa && document._qsa.push(this))}`;
176176
window.scrollBy(0, 0);
177177
style.parentNode.removeChild(style);
178178

0 commit comments

Comments
 (0)
0