diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-05-14 01:30:56 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-05-14 01:30:56 -0400 |
commit | 1a80bcb250c81a8959b8af816f499c22bca0db51 (patch) | |
tree | 449d9c35437d995e02c473e8b328dbcd3f43367f /main.ts | |
parent | bfb3cd7a5c55dbf59eacb7d93e88f38632e47260 (diff) |
Add console.log
Diffstat (limited to 'main.ts')
-rw-r--r-- | main.ts | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -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"); |