mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
19 lines
422 B
JavaScript
19 lines
422 B
JavaScript
// 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);
|
|
});
|
|
}
|