summaryrefslogtreecommitdiff
path: root/js/main.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2018-11-20 10:51:35 +1100
committerRyan Dahl <ry@tinyclouds.org>2018-11-20 08:46:56 -0800
commit3d03f5b0cb3c513e449f3aaa5d35c493b72f47b4 (patch)
treece5d20849c3bc10aca0708f8d3910c8ab4cd82fd /js/main.ts
parent3597d6859cacf0ef3ef935ad7d4e98d4df4a15ff (diff)
Split Runner from Compiler
Diffstat (limited to 'js/main.ts')
-rw-r--r--js/main.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/main.ts b/js/main.ts
index 6f2d0fcfa..241e8d7d1 100644
--- a/js/main.ts
+++ b/js/main.ts
@@ -6,7 +6,8 @@ import * as flatbuffers from "./flatbuffers";
import * as msg from "gen/msg_generated";
import { assert, log, setLogDebug } from "./util";
import * as os from "./os";
-import { DenoCompiler } from "./compiler";
+import { Compiler } from "./compiler";
+import { Runner } from "./runner";
import { libdeno } from "./libdeno";
import { args } from "./deno";
import { sendSync, handleAsyncMsgFromRust } from "./dispatch";
@@ -17,7 +18,7 @@ import { version } from "typescript";
// Install the source maps handler and do some pre-calculations so all of it is
// available in the snapshot
-const compiler = DenoCompiler.instance();
+const compiler = Compiler.instance();
sourceMaps.install({
installPrepareStackTrace: true,
getGeneratedContents: compiler.getGeneratedContents
@@ -70,8 +71,7 @@ export default function denoMain() {
// handle `--types`
if (startResMsg.typesFlag()) {
const defaultLibFileName = compiler.getDefaultLibFileName();
- const defaultLibModule = compiler.resolveModule(defaultLibFileName, "");
- console.log(defaultLibModule.sourceCode);
+ console.log(compiler.getSource(defaultLibFileName));
os.exit(0);
}
@@ -94,9 +94,10 @@ export default function denoMain() {
const inputFn = args[0];
compiler.recompile = startResMsg.recompileFlag();
+ const runner = new Runner(compiler);
if (inputFn) {
- compiler.run(inputFn, `${cwd}/`);
+ runner.run(inputFn, `${cwd}/`);
} else {
replLoop();
}