diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-07-13 03:24:07 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-07-18 15:43:50 -0400 |
commit | 3e51605bc9ca98522fc21a0673e690105f48da98 (patch) | |
tree | 1c31da16173d95d6623721414b402d1dcdf069b4 /js/main.ts | |
parent | 8a4e3dfda4975540d6e0059248477facfe03c31c (diff) |
Execute JS for the first time in Rust rewrite.
Implements code_fetch handler in Rust.
Add ability to embed string assets (for typescript declaration files)
Remove deno_cc and deno_cc_nosnapshot targets.
Diffstat (limited to 'js/main.ts')
-rw-r--r-- | js/main.ts | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/js/main.ts b/js/main.ts index 379b69c97..c140304ef 100644 --- a/js/main.ts +++ b/js/main.ts @@ -1,12 +1,9 @@ // tslint:disable-next-line:no-reference /// <reference path="deno.d.ts" /> -import * as ts from "typescript"; - import { flatbuffers } from "flatbuffers"; import { deno as fbs } from "./msg_generated"; -import { assert } from "./util"; - -// import * as runtime from "./runtime"; +import { assert, log } from "./util"; +import * as runtime from "./runtime"; const globalEval = eval; const window = globalEval("this"); @@ -31,8 +28,6 @@ function startMsg(cmdId: number): Uint8Array { } window["denoMain"] = () => { - deno.print(`ts.version: ${ts.version}`); - // First we send an empty "Start" message to let the privlaged side know we // are ready. The response should be a "StartRes" message containing the CLI // argv and other info. @@ -55,17 +50,15 @@ window["denoMain"] = () => { assert(base.msg(startResMsg) != null); const cwd = startResMsg.cwd(); - deno.print(`cwd: ${cwd}`); + log("cwd", cwd); const argv: string[] = []; for (let i = 0; i < startResMsg.argvLength(); i++) { argv.push(startResMsg.argv(i)); } - deno.print(`argv ${argv}`); + log("argv", argv); - /* TODO(ry) Uncomment to test further message passing. - const inputFn = argv[0]; + const inputFn = argv[1]; const mod = runtime.resolveModule(inputFn, `${cwd}/`); mod.compileAndRun(); - */ }; |