summaryrefslogtreecommitdiff
path: root/deno2/js/main.ts
diff options
context:
space:
mode:
authorTristan Marion <trismarion@gmail.com>2018-06-22 15:30:35 +0200
committerRyan Dahl <ry@tinyclouds.org>2018-06-22 15:30:35 +0200
commit3b595253a2e9f8badc416f85d0b09bf48f344634 (patch)
tree85939e43b504cf0ff78f69a1912209e90b67ffe5 /deno2/js/main.ts
parent86354a29a40fb97e334f951428239ab8e171e2dd (diff)
Move `deno2` folder to `src` (#277)
Diffstat (limited to 'deno2/js/main.ts')
-rw-r--r--deno2/js/main.ts41
1 files changed, 0 insertions, 41 deletions
diff --git a/deno2/js/main.ts b/deno2/js/main.ts
deleted file mode 100644
index d2d61f419..000000000
--- a/deno2/js/main.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-/// <reference path="deno.d.ts" />
-import { deno as pb } from "./msg.pb";
-import * as ts from "typescript";
-
-const globalEval = eval;
-const window = globalEval("this");
-
-window["denoMain"] = () => {
- deno.print(`ts.version: ${ts.version}`);
- const res = deno.pub("startDeno2", emptyArrayBuffer());
- //deno.print(`after`);
- const resUi8 = new Uint8Array(res);
- deno.print(`before`);
- const msg = pb.Msg.decode(resUi8);
- deno.print(`after`);
- const {
- startCwd: cwd,
- startArgv: argv,
- startDebugFlag: debugFlag,
- startMainJs: mainJs,
- startMainMap: mainMap
- } = msg;
-
- deno.print(`cwd: ${cwd}`);
- deno.print(`debugFlag: ${debugFlag}`);
-
- for (let i = 0; i < argv.length; i++) {
- deno.print(`argv[${i}] ${argv[i]}`);
- }
-};
-
-function typedArrayToArrayBuffer(ta: Uint8Array): ArrayBuffer {
- return ta.buffer.slice(
- ta.byteOffset,
- ta.byteOffset + ta.byteLength
- ) as ArrayBuffer;
-}
-
-function emptyArrayBuffer(): ArrayBuffer {
- return typedArrayToArrayBuffer(new Uint8Array([]));
-}