mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 02:37:41 -05:00
Use registerJSModule when available (#1573)
This commit is contained in:
committed by
GitHub
parent
7813c3f03f
commit
a14e701be4
@@ -58,11 +58,10 @@ const execute = async (script, source, XWorker, isAsync) => {
|
||||
configurable: true,
|
||||
get: () => script,
|
||||
});
|
||||
module.setGlobal(interpreter, "XWorker", XWorker);
|
||||
module.registerJSModule(interpreter, "xworker", { XWorker });
|
||||
return module[isAsync ? "runAsync" : "run"](interpreter, content);
|
||||
} finally {
|
||||
delete document.currentScript;
|
||||
module.deleteGlobal(interpreter, "XWorker");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user