This commit is contained in:
Dmitry Vasilev
2022-11-29 03:37:15 +08:00
parent 1c07a092e7
commit 0332d5a0b8
4 changed files with 21 additions and 17 deletions

View File

@@ -58,8 +58,8 @@ type Node = ToplevelCall | Call
// TODO just export const Iframe_Function?
const make_function = (...args) => {
if(globalThis.process != null) {
// Tests are run in Node.js
if(globalThis.run_window == null) {
// Code is executed in test env
return new Function(...args)
} else {
// Code run in browser and user opened run_window