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); }, err);
} }
function loadScript(scripts) { function loadScript(...scripts) {
if (!Array.isArray(scripts)) {
scripts = [scripts];
}
const urls = scripts.filter(u => !loadedScripts.has(u)); const urls = scripts.filter(u => !loadedScripts.has(u));
if (!urls.length) { if (!urls.length) {
return; return;