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.
This commit is contained in:
Ryan Dahl 2018-07-13 03:24:07 -04:00
parent 8a4e3dfda4
commit 3e51605bc9
17 changed files with 514 additions and 205 deletions

View file

@ -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();
*/
};