open window to run code

This commit is contained in:
Dmitry Vasilev
2022-10-26 01:05:52 +08:00
parent 9ab8ddec68
commit 30e318a2c4
4 changed files with 36 additions and 13 deletions

View File

@@ -10,6 +10,13 @@ const EXAMPLE = `const fib = n =>
: fib(n - 1) + fib(n - 2)
fib(6)`
export const open_run_window = () => {
if(globalThis.run_window != null) {
globalThis.run_window.close()
}
globalThis.run_window = open('about:blank')
}
const read_modules = async () => {
const default_module = {'': localStorage.code || EXAMPLE}
const current = {