mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 04:51:22 +00:00
Minor clean up
This commit is contained in:
parent
6f59a9588b
commit
7828d7fd7a
3
main.go
3
main.go
@ -60,6 +60,7 @@ func main() {
|
||||
}
|
||||
err = worker.SendBytes(out)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
os.Stderr.WriteString(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
3
main.ts
3
main.ts
@ -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");
|
||||
|
4
util.ts
4
util.ts
@ -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(" "));
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user