Files
pyscript/pyscript.core/test/mocked/micropython.mjs
2023-06-29 22:50:35 +02:00

21 lines
484 B
JavaScript

export const python = { content: "", target: null };
export const loadMicroPython = () => ({
registerJsModule() {
},
runPython(content) {
if (document.currentScript?.target) {
python.content = content;
python.target = document.currentScript.target;
}
},
globals: {
set(name, value) {
globalThis[name] = value;
},
delete(name) {
delete globalThis[name];
},
},
});