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';
// eslint-disable-next-line no-var
var usercssHelper = (function () {
var usercssHelper = (() => {
function buildMeta(style) {
if (style.usercssData) {
return Promise.resolve(style);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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