Fix: use spread syntax in loadScript

This commit is contained in:
eight 2018-09-25 21:16:59 +08:00
parent b853be13f8
commit ba5d6cc31a

View File

@ -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;