mirror of
https://github.com/denoland/deno.git
synced 2024-10-31 09:14:20 -04:00
9590c87c62
And fix ArrayBuffer memory problem.
18 lines
407 B
JavaScript
18 lines
407 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 recvabc() {
|
|
deno_recv((msg) => {
|
|
assert(msg instanceof ArrayBuffer);
|
|
assert(msg.byteLength === 3);
|
|
});
|
|
}
|