From 1a80bcb250c81a8959b8af816f499c22bca0db51 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 14 May 2018 01:30:56 -0400 Subject: Add console.log --- main.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'main.ts') diff --git a/main.ts b/main.ts index 44519489a..153414a19 100644 --- a/main.ts +++ b/main.ts @@ -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"); -- cgit v1.2.3