wasm-idle 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,7 +5,7 @@ import { load } from "../playground";
|
|
|
5
5
|
import "xterm/css/xterm.css";
|
|
6
6
|
const dispatch = createEventDispatcher();
|
|
7
7
|
let ref, clientWidth, clientHeight, term, finish = true, input = "", sandbox, first = true;
|
|
8
|
-
const wait = new Promise((r) => {
|
|
8
|
+
const wait = () => new Promise((r) => {
|
|
9
9
|
const i = setInterval(() => {
|
|
10
10
|
if (term) {
|
|
11
11
|
clearInterval(i);
|
|
@@ -15,7 +15,7 @@ const wait = new Promise((r) => {
|
|
|
15
15
|
});
|
|
16
16
|
export const terminal = {
|
|
17
17
|
async clear() {
|
|
18
|
-
await wait;
|
|
18
|
+
await wait();
|
|
19
19
|
term.clear();
|
|
20
20
|
term.write(`\x1B[?25l`);
|
|
21
21
|
term.write("\x1B[0m");
|
|
@@ -23,7 +23,7 @@ export const terminal = {
|
|
|
23
23
|
first = true;
|
|
24
24
|
},
|
|
25
25
|
async run(language, code, log = true) {
|
|
26
|
-
await wait;
|
|
26
|
+
await wait();
|
|
27
27
|
if (sandbox)
|
|
28
28
|
await sandbox.clear();
|
|
29
29
|
input = "";
|