diff options
author | Ry Dahl <ry@tinyclouds.org> | 2020-01-21 14:57:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-21 14:57:56 -0500 |
commit | fa7f34eb8cec07f4c68ca4e9c46a983bc3e2308f (patch) | |
tree | 821263579dd75de3c16508fdecfdcaba52987373 /cli/js/compiler_bootstrap.ts | |
parent | 7fd50065a7d8a4c6ed1b1090703a7baaabdbd6aa (diff) |
Revert "Create an old program to be used in snapshot. (#3644)"
Ref #3712. This change allowed the deno_typescript crate to reference
cli/js/lib.deno_runtime.d.ts which breaks "cargo package". We intend to
reintroduce a revised version of this patch later once "cargo
package" is working and tested.
This reverts commit 737ab94ea1bdf65eeef323ea37e84bcf430fb92c.
Diffstat (limited to 'cli/js/compiler_bootstrap.ts')
-rw-r--r-- | cli/js/compiler_bootstrap.ts | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/cli/js/compiler_bootstrap.ts b/cli/js/compiler_bootstrap.ts deleted file mode 100644 index 6de978750..000000000 --- a/cli/js/compiler_bootstrap.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. - -import { ASSETS, Host } from "./compiler_host.ts"; -import { core } from "./core.ts"; -import * as dispatch from "./dispatch.ts"; -import { sendSync } from "./dispatch_json.ts"; - -// This registers ops that are available during the snapshotting process. -const ops = core.ops(); -for (const [name, opId] of Object.entries(ops)) { - const opName = `OP_${name.toUpperCase()}`; - // TODO This type casting is dangerous, and should be improved when the same - // code in `os.ts` is done. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (dispatch as any)[opName] = opId; -} - -const host = new Host({ writeFile(): void {} }); -const options = host.getCompilationSettings(); - -/** Used to generate the foundational AST for all other compilations, so it can - * be cached as part of the snapshot and available to speed up startup */ -export const oldProgram = ts.createProgram({ - rootNames: [`${ASSETS}/bootstrap.ts`], - options, - host -}); - -/** A module loader which is concatenated into bundle files. We read all static - * assets during the snapshotting process, which is why this is located in - * compiler_bootstrap. */ -export const bundleLoader = sendSync(dispatch.OP_FETCH_ASSET, { - name: "bundle_loader.js" -}); |