mirror of
https://github.com/denoland/deno.git
synced 2025-01-23 15:39:49 -05:00
18 lines
405 B
JavaScript
18 lines
405 B
JavaScript
// A simple runtime that doesn't involve typescript or protobufs to test
|
|
// libdeno.
|
|
const window = eval("this");
|
|
window['foo'] = () => {
|
|
deno_print("Hello world from foo");
|
|
return "foo";
|
|
}
|
|
|
|
function assert(cond) {
|
|
if (!cond) throw Error("mock_runtime.js assert failed");
|
|
}
|
|
|
|
function subabc() {
|
|
deno_sub((msg) => {
|
|
assert(msg instanceof ArrayBuffer);
|
|
assert(msg.byteLength === 3);
|
|
});
|
|
}
|