fixed window:

This commit is contained in:
Jade (Rose) Rowland 2024-06-14 20:42:39 -04:00
parent f3b83b41f5
commit 5e9da78e64

View File

@ -40,7 +40,9 @@ function safeEval(str, options = {}) {
export const evaluate = async (code, transpiler, transpilerOptions) => {
let meta = {};
//post to iframe parent (like Udels) if it exists...
window.parent?.postMessage(code);
if (typeof window !== 'undefined') {
window.parent?.postMessage(code);
}
if (transpiler) {
// transform syntactically correct js code to semantically usable code
const transpiled = transpiler(code, transpilerOptions);