Public
Script
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
export async function run(req: express.Request, res: express.Response) {
let c = (
s,
i,
b,
l,
n,
) => (i = { "+": 106, "-": 107, "*": 108, "/": 110 },
b = s.trim().split(/\s+/).map((
t,
) => (n = parseInt(t, 10), n == n ? [65, n] : i[t])).flat(),
l = b.length,
WebAssembly.instantiate(Uint8Array.from([
0,
97,
115,
109,
1,
0,
0,
0,
1,
5,
1,
96,
0,
1,
127,
3,
2,
1,
0,
7,
5,
1,
1,
97,
0,
0,
10,
4 + l,
1,
2 + l,
0,
...b,
11,
])));
return res.send(
`<h1>Result ${(await c(req.query.code)).instance.exports.a()}!</h1>`,
);
}
October 23, 2023