blob: cd9766685162d2e692d7edb2d8a3aee63526851b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// A simple runtime that doesn't involve typescript or protobufs to test
// libdeno.
const globalEval = eval;
const window = globalEval("this");
window['foo'] = () => {
deno_print("Hello world from foo");
return "foo";
}
function assert(cond) {
if (!cond) throw Error("assert failed");
}
function recvabc() {
deno_recv((msg) => {
assert(msg instanceof ArrayBuffer);
assert(msg.byteLength === 3);
});
}
|