From fe8c5d358ba7765b591f4087232f16a6a60f420e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 11 Feb 2019 00:18:36 +0100 Subject: [PATCH] Set globals on compiler startup (#1735) --- js/compiler.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/js/compiler.ts b/js/compiler.ts index acbdbbd61d..904e38eba6 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); }