diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-02-12 21:14:02 -0500 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-02-18 23:04:59 -0500 |
commit | 42408febe8cdf9e30ff8d1a3bb13f4994906c53b (patch) | |
tree | 92ab3408d426f1d18a511aa16130357ed074410a /js/main.ts | |
parent | 27afbd135162b435c8af22b18622656ccab12174 (diff) |
Add window.location
Diffstat (limited to 'js/main.ts')
-rw-r--r-- | js/main.ts | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/js/main.ts b/js/main.ts index a5aae51a1..b67f188ac 100644 --- a/js/main.ts +++ b/js/main.ts @@ -4,12 +4,13 @@ import "./globals"; -import { log } from "./util"; +import { assert, log } from "./util"; import * as os from "./os"; import { libdeno } from "./libdeno"; import { args } from "./deno"; import { replLoop } from "./repl"; import { setVersions } from "./version"; +import { setLocation } from "./location"; // builtin modules import * as deno from "./deno"; @@ -42,6 +43,12 @@ export default function denoMain() { os.exit(0); } + const mainModule = startResMsg.mainModule(); + if (mainModule) { + assert(mainModule.length > 0); + setLocation(mainModule); + } + const cwd = startResMsg.cwd(); log("cwd", cwd); @@ -51,8 +58,7 @@ export default function denoMain() { log("args", args); Object.freeze(args); - const inputFn = args[0]; - if (!inputFn) { + if (!mainModule) { replLoop(); } } |