mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 18:55:29 -05:00
Wait for plugins before defining the custom type (#1788)
This commit is contained in:
committed by
GitHub
parent
b4503ef729
commit
d5b6935c0b
@@ -50,7 +50,7 @@ const syntaxError = (type, url, { message }) => {
|
||||
const configs = new Map();
|
||||
|
||||
for (const [TYPE] of TYPES) {
|
||||
/** @type {Promise<any> | undefined} A Promise wrapping any plugins which should be loaded. */
|
||||
/** @type {Promise<[...any]>} A Promise wrapping any plugins which should be loaded. */
|
||||
let plugins;
|
||||
|
||||
/** @type {any} The PyScript configuration parsed from the JSON or TOML object*. May be any of the return types of JSON.parse() or toml-j0.4's parse() ( {number | string | boolean | null | object | Array} ) */
|
||||
@@ -119,7 +119,7 @@ for (const [TYPE] of TYPES) {
|
||||
}
|
||||
|
||||
// assign plugins as Promise.all only if needed
|
||||
if (toBeAwaited.length) plugins = Promise.all(toBeAwaited);
|
||||
plugins = Promise.all(toBeAwaited);
|
||||
|
||||
configs.set(TYPE, { config: parsed, plugins, error });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user