From fa7f34eb8cec07f4c68ca4e9c46a983bc3e2308f Mon Sep 17 00:00:00 2001 From: Ry Dahl Date: Tue, 21 Jan 2020 14:57:56 -0500 Subject: 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. --- cli/js.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cli/js.rs') diff --git a/cli/js.rs b/cli/js.rs index d6a360b52..bf13d704d 100644 --- a/cli/js.rs +++ b/cli/js.rs @@ -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( -- cgit v1.2.3