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.rs | |
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.rs')
-rw-r--r-- | cli/js.rs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -16,6 +16,16 @@ pub static COMPILER_SNAPSHOT_MAP: &[u8] = pub static COMPILER_SNAPSHOT_DTS: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/COMPILER_SNAPSHOT.d.ts")); +static DENO_RUNTIME: &str = include_str!("js/lib.deno_runtime.d.ts"); + +/// Same as deno_typescript::get_asset but also has lib.deno_runtime.d.ts +pub fn get_asset(name: &str) -> Option<&'static str> { + match name { + "lib.deno_runtime.d.ts" => Some(DENO_RUNTIME), + _ => deno_typescript::get_asset(name), + } +} + #[test] fn cli_snapshot() { let mut isolate = deno_core::Isolate::new( |