Fix: use arrow function for IIFE

This commit is contained in:
eight 2017-10-30 01:22:10 +08:00
parent adc0c8025a
commit 62748b3b79
7 changed files with 8 additions and 8 deletions

View File

@ -3,7 +3,7 @@
'use strict'; 'use strict';
// eslint-disable-next-line no-var // eslint-disable-next-line no-var
var usercssHelper = (function () { var usercssHelper = (() => {
function buildMeta(style) { function buildMeta(style) {
if (style.usercssData) { if (style.usercssData) {
return Promise.resolve(style); return Promise.resolve(style);

View File

@ -3,7 +3,7 @@
'use strict'; 'use strict';
// eslint-disable-next-line no-var // eslint-disable-next-line no-var
var regExpTester = (function () { var regExpTester = (() => {
const GET_FAVICON_URL = 'https://www.google.com/s2/favicons?domain='; const GET_FAVICON_URL = 'https://www.google.com/s2/favicons?domain=';
const OWN_ICON = chrome.runtime.getManifest().icons['16']; const OWN_ICON = chrome.runtime.getManifest().icons['16'];
const cachedRegexps = new Map(); const cachedRegexps = new Map();

View File

@ -2,7 +2,7 @@
'use strict'; 'use strict';
(function () { (() => {
const params = getParams(); const params = getParams();
let liveReload = false; let liveReload = false;
let installed = false; let installed = false;

View File

@ -103,7 +103,7 @@ function tNodeList(nodes) {
function tDocLoader() { function tDocLoader() {
t.DOMParser = new DOMParser(); t.DOMParser = new DOMParser();
t.cache = (function () { t.cache = (() => {
try { try {
return JSON.parse(localStorage.L10N); return JSON.parse(localStorage.L10N);
} catch (e) {} } catch (e) {}

View File

@ -3,7 +3,7 @@
'use strict'; 'use strict';
// eslint-disable-next-line no-var // eslint-disable-next-line no-var
var mozParser = (function () { var mozParser = (() => {
// direct & reverse mapping of @-moz-document keywords and internal property names // direct & reverse mapping of @-moz-document keywords and internal property names
const propertyToCss = {urls: 'url', urlPrefixes: 'url-prefix', domains: 'domain', regexps: 'regexp'}; const propertyToCss = {urls: 'url', urlPrefixes: 'url-prefix', domains: 'domain', regexps: 'regexp'};
const CssToProperty = {'url': 'urls', 'url-prefix': 'urlPrefixes', 'domain': 'domains', 'regexp': 'regexps'}; const CssToProperty = {'url': 'urls', 'url-prefix': 'urlPrefixes', 'domain': 'domains', 'regexp': 'regexps'};

View File

@ -2,7 +2,7 @@
// loadScript(script: Array<Promise|string>|string): Promise // loadScript(script: Array<Promise|string>|string): Promise
// eslint-disable-next-line no-var // eslint-disable-next-line no-var
var loadScript = (function () { var loadScript = (() => {
const cache = new Map(); const cache = new Map();
function inject(file) { function inject(file) {

View File

@ -3,7 +3,7 @@
'use strict'; 'use strict';
// eslint-disable-next-line no-var // eslint-disable-next-line no-var
var usercss = (function () { var usercss = (() => {
// true for global, false for private // true for global, false for private
const METAS = { const METAS = {
__proto__: null, __proto__: null,
@ -99,7 +99,7 @@ var usercss = (function () {
} }
}; };
const colorParser = (function () { const colorParser = (() => {
const el = document.createElement('div'); const el = document.createElement('div');
// https://bugs.webkit.org/show_bug.cgi?id=14563 // https://bugs.webkit.org/show_bug.cgi?id=14563
document.head.appendChild(el); document.head.appendChild(el);