فهرست منبع

fixed eslint warnings

Former-commit-id: 9bcaebc7282c6e81d2c7f40e2271a60804098583
= 6 سال پیش
والد
کامیت
8e0b464fef
1فایلهای تغییر یافته به همراه5 افزوده شده و 6 حذف شده
  1. 5 6
      lib/single-file/modules/css-fonts-alt-minifier.js

+ 5 - 6
lib/single-file/modules/css-fonts-alt-minifier.js

@@ -21,7 +21,7 @@
  *   Source.
  */
 
-/* global window */
+/* global window, setTimeout */
 
 this.singlefile.lib.modules.fontsAltMinifier = this.singlefile.lib.modules.fontsAltMinifier || (() => {
 
@@ -221,11 +221,10 @@ this.singlefile.lib.modules.fontsAltMinifier = this.singlefile.lib.modules.fonts
 					const fontFace = new FontFace("test-font", "url(" + fontURL + ")");
 					try {
 						await Promise.race(
-							[fontFace.load().then(() => fontFace.loaded).then(() => source.valid = true),
-							new Promise(resolve => setTimeout(() => {
-								source.valid = true;
-								resolve();
-							}, FONT_MAX_LOAD_DELAY))]);
+							[
+								fontFace.load().then(() => fontFace.loaded).then(() => source.valid = true),
+								new Promise(resolve => setTimeout(() => { source.valid = true; resolve(); }, FONT_MAX_LOAD_DELAY))
+							]);
 					} catch (error) {
 						// ignored
 					}