Don't fail on unknown packages

This commit is contained in:
Michael Droettboom 2018-06-19 13:26:16 -04:00
parent dbc0de25c2
commit d254f5b6e1
1 changed files with 9 additions and 8 deletions

View File

@ -29,16 +29,17 @@ var languagePluginLoader = new Promise((resolve, reject) => {
let toLoad = new Set(); let toLoad = new Set();
while (queue.length) { while (queue.length) {
const package = queue.pop(); const package = queue.pop();
if (!packages.hasOwnProperty(package)) {
throw `Unknown package '${package}'`;
}
if (!loadedPackages.has(package)) { if (!loadedPackages.has(package)) {
toLoad.add(package); toLoad.add(package);
packages[package].forEach((subpackage) => { if (packages.hasOwnProperty(package)) {
if (!loadedPackages.has(subpackage) && !toLoad.has(subpackage)) { packages[package].forEach((subpackage) => {
queue.push(subpackage); if (!loadedPackages.has(subpackage) && !toLoad.has(subpackage)) {
} queue.push(subpackage);
}); }
});
} else {
console.log(`Unknown package '${package}'`);
}
} }
} }