mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 14:26:58 -04:00
fixed window:
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user