Add console.log

This commit is contained in:
Ryan Dahl 2018-05-14 01:30:56 -04:00
parent bfb3cd7a5c
commit 1a80bcb250
3 changed files with 41 additions and 4 deletions

17
main.ts
View file

@ -1,9 +1,22 @@
//import * as ts from "typescript";
import { main as pb } from "./msg.pb"
import "./util";
function load(argv: string[]): void {
console.log("Load argv", argv);
}
V8Worker2.recv((ab: ArrayBuffer) => {
let msg = pb.Msg.decode(new Uint8Array(ab));
V8Worker2.print("msg.argv", msg.argv);
const msg = pb.Msg.decode(new Uint8Array(ab));
switch (msg.kind) {
case pb.Msg.MsgKind.LOAD:
load(msg.argv);
break;
default:
console.log("Unknown message", msg);
break;
}
});
V8Worker2.print("Hello");