mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 04:48:52 -05:00
21 lines
491 B
TypeScript
21 lines
491 B
TypeScript
import { main as pb } from "./msg.pb";
|
|
import "./util";
|
|
import { compile } from "./compiler";
|
|
|
|
function start(cwd: string, argv: string[]): void {
|
|
// TODO parse arguments.
|
|
const inputFn = argv[1];
|
|
compile(cwd, inputFn);
|
|
}
|
|
|
|
V8Worker2.recv((ab: ArrayBuffer) => {
|
|
const msg = pb.Msg.decode(new Uint8Array(ab));
|
|
switch (msg.kind) {
|
|
case pb.Msg.MsgKind.START:
|
|
start(msg.cwd, msg.argv);
|
|
break;
|
|
default:
|
|
console.log("Unknown message", msg);
|
|
break;
|
|
}
|
|
});
|