Minor clean up

This commit is contained in:
Ryan Dahl 2018-05-14 03:12:36 -04:00
parent 6f59a9588b
commit 7828d7fd7a
3 changed files with 5 additions and 5 deletions

View File

@ -60,6 +60,7 @@ func main() {
}
err = worker.SendBytes(out)
if err != nil {
panic(err)
os.Stderr.WriteString(err.Error())
os.Exit(1)
}
}

View File

@ -20,7 +20,6 @@ function readFileSync(filename: string): string {
}
function load(argv: string[]): void {
console.log("Load argv", argv);
const inputFn = argv[1];
const source = readFileSync(inputFn);
console.log("source", source);
@ -37,5 +36,3 @@ V8Worker2.recv((ab: ArrayBuffer) => {
break;
}
});
V8Worker2.print("Hello");

View File

@ -8,6 +8,8 @@ const globalEval = eval;
// A reference to the global object.
const _global = globalEval("this");
const print = V8Worker2.print;
_global["console"] = {
// tslint:disable-next-line:no-any
log(...args: any[]): void {
@ -19,6 +21,6 @@ _global["console"] = {
out.push(JSON.stringify(a));
}
}
V8Worker2.print(out.join(" "));
print(out.join(" "));
}
};