diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-02-11 00:18:36 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-02-10 18:18:36 -0500 |
commit | fe8c5d358ba7765b591f4087232f16a6a60f420e (patch) | |
tree | 92e7bd87de01290080b3665af0c40fc8cf1b6718 /js/compiler.ts | |
parent | 1d36eb47eb882cb9305a6338019fa2a2b375d7b1 (diff) |
Set globals on compiler startup (#1735)
Diffstat (limited to 'js/compiler.ts')
-rw-r--r-- | js/compiler.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/js/compiler.ts b/js/compiler.ts index acbdbbd61..904e38eba 100644 --- a/js/compiler.ts +++ b/js/compiler.ts @@ -6,6 +6,7 @@ import { Console } from "./console"; import { globalEval } from "./global_eval"; import { libdeno } from "./libdeno"; import * as os from "./os"; +import { args } from "./deno"; import { TextDecoder, TextEncoder } from "./text_encoding"; import { clearTimer, setTimeout } from "./timers"; import { postMessage, workerClose, workerMain } from "./workers"; @@ -540,5 +541,13 @@ window.compilerMain = function compilerMain() { /* tslint:disable-next-line:no-default-export */ export default function denoMain() { - os.start("TS"); + const startResMsg = os.start("TS"); + + os.setGlobals(startResMsg.pid(), startResMsg.noColor()); + + for (let i = 1; i < startResMsg.argvLength(); i++) { + args.push(startResMsg.argv(i)); + } + log("args", args); + Object.freeze(args); } |