mirror of
https://github.com/pyscript/pyscript.git
synced 2026-02-19 16:00:42 -05:00
committed by
GitHub
parent
af72e232c3
commit
7d3b792a79
@@ -13,8 +13,18 @@ const RUNTIME_SELECTOR = selectors.join(",");
|
||||
|
||||
// ensure both runtime and its queue are awaited then returns the runtime
|
||||
const awaitRuntime = async (key) => {
|
||||
const { runtime, queue } = runtimes.get(key);
|
||||
return (await all([runtime, queue]))[0];
|
||||
if (runtimes.has(key)) {
|
||||
const { runtime, queue } = runtimes.get(key);
|
||||
return (await all([runtime, queue]))[0];
|
||||
}
|
||||
|
||||
const available = runtimes.size
|
||||
? `Available runtimes are: ${[...runtimes.keys()]
|
||||
.map((r) => `"${r}"`)
|
||||
.join(", ")}.`
|
||||
: `There are no runtimes in this page.`;
|
||||
|
||||
throw new Error(`The runtime "${key}" was not found. ${available}`);
|
||||
};
|
||||
|
||||
defineProperty(globalThis, "pyscript", {
|
||||
|
||||
@@ -50,6 +50,6 @@
|
||||
"coincident": "^0.2.3"
|
||||
},
|
||||
"worker": {
|
||||
"blob": "sha256-T0DDfoQde+3gciIoHqPGP2SgMQpbY/nAMjfd1cg8jyA="
|
||||
"blob": "sha256-XIl723wj4b0gyB5IGnLem05DRvl5bzkeMahwAmQFMrM="
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user