From ba5d6cc31a7d6dbbd9e278c809ec17009c155bf8 Mon Sep 17 00:00:00 2001 From: eight Date: Tue, 25 Sep 2018 21:16:59 +0800 Subject: [PATCH] Fix: use spread syntax in loadScript --- js/worker-util.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/js/worker-util.js b/js/worker-util.js index dd19ac6c..5e081959 100644 --- a/js/worker-util.js +++ b/js/worker-util.js @@ -87,10 +87,7 @@ var workerUtil = (() => { }, err); } - function loadScript(scripts) { - if (!Array.isArray(scripts)) { - scripts = [scripts]; - } + function loadScript(...scripts) { const urls = scripts.filter(u => !loadedScripts.has(u)); if (!urls.length) { return;