Gildas 7 лет назад
Родитель
Сommit
f613ad2f64
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      lib/single-file/font-face-proxy.js

+ 2 - 1
lib/single-file/font-face-proxy.js

@@ -3,11 +3,12 @@
 
 
 this.fontFaceProxy = this.fontFaceProxy || (() => {
 this.fontFaceProxy = this.fontFaceProxy || (() => {
 
 
+	const fontFaces = [];
+
 	if (document instanceof HTMLDocument) {
 	if (document instanceof HTMLDocument) {
 		const scriptElement = document.createElement("script");
 		const scriptElement = document.createElement("script");
 		scriptElement.textContent = `(${hook.toString()})()`;
 		scriptElement.textContent = `(${hook.toString()})()`;
 		document.documentElement.appendChild(scriptElement);
 		document.documentElement.appendChild(scriptElement);
-		const fontFaces = [];
 		addEventListener("single-file-font-face", event => fontFaces.push(event.detail));
 		addEventListener("single-file-font-face", event => fontFaces.push(event.detail));
 	}
 	}