Added __terminal__ in non-persistent donkey (#2260)

This commit is contained in:
Andrea Giammarchi
2024-12-06 14:53:09 +01:00
committed by GitHub
parent 0d74a60227
commit d143b229ed
3 changed files with 102 additions and 86 deletions

View File

@@ -6,7 +6,8 @@ const { stringify } = JSON;
const invoke = (name, args) => `${name}(code, ${args.join(", ")})`;
const donkey = ({ type = "py", persistent, terminal, config }) => {
const args = persistent ? ["globals()", "__locals__"] : ["{}", "{}"];
const globals = terminal ? '{"__terminal__":__terminal__}' : "{}";
const args = persistent ? ["globals()", "__locals__"] : [globals, "{}"];
const src = URL.createObjectURL(
new Blob([