Selaa lähdekoodia

removed obsolete closure

Gildas 7 vuotta sitten
vanhempi
sitoutus
4374f67757
1 muutettua tiedostoa jossa 12 lisäystä ja 14 poistoa
  1. 12 14
      extension/core/bg/core.js

+ 12 - 14
extension/core/bg/core.js

@@ -147,21 +147,19 @@ singlefile.core = (() => {
 	}
 
 	async function getScript(scriptFiles) {
-		return (async () => {
-			const scriptsPromises = scriptFiles.map(async scriptFile => {
-				if (typeof scriptFile == "function") {
-					return "(" + scriptFile.toString() + ")();";
-				} else {
-					const scriptResource = await fetch(browser.runtime.getURL(scriptFile));
-					return new TextDecoder().decode(await scriptResource.arrayBuffer());
-				}
-			});
-			let content = "";
-			for (const scriptPromise of scriptsPromises) {
-				content += await scriptPromise;
+		const scriptsPromises = scriptFiles.map(async scriptFile => {
+			if (typeof scriptFile == "function") {
+				return "(" + scriptFile.toString() + ")();";
+			} else {
+				const scriptResource = await fetch(browser.runtime.getURL(scriptFile));
+				return new TextDecoder().decode(await scriptResource.arrayBuffer());
 			}
-			return content;
-		})();
+		});
+		let content = "";
+		for (const scriptPromise of scriptsPromises) {
+			content += await scriptPromise;
+		}
+		return content;
 	}
 
 })();