1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

refactor(cli): Remove dead code (#6765)

This commit is contained in:
Ryan Dahl 2020-07-16 04:53:58 -04:00 committed by GitHub
parent 98e0ed54db
commit 6c637f04bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 40 deletions

View file

@ -32,16 +32,6 @@ fn main() {
let extern_crate_modules = include_crate_modules![deno_core];
// The generation of snapshots is slow and often unnecessary. Until we figure
// out how to speed it up, or avoid it when unnecessary, this env var provides
// an escape hatch for the impatient hacker in need of faster incremental
// builds.
// USE WITH EXTREME CAUTION
if env::var_os("NO_BUILD_SNAPSHOTS").is_some() {
println!("NO_BUILD_SNAPSHOTS is set, skipping snapshot building.");
return;
}
let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
let o = PathBuf::from(env::var_os("OUT_DIR").unwrap());

View file

@ -4,17 +4,11 @@ pub static CLI_SNAPSHOT: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.bin"));
pub static CLI_SNAPSHOT_MAP: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.js.map"));
#[allow(dead_code)]
pub static CLI_SNAPSHOT_DTS: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/CLI_SNAPSHOT.d.ts"));
pub static COMPILER_SNAPSHOT: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/COMPILER_SNAPSHOT.bin"));
pub static COMPILER_SNAPSHOT_MAP: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/COMPILER_SNAPSHOT.js.map"));
#[allow(dead_code)]
pub static COMPILER_SNAPSHOT_DTS: &[u8] =
include_bytes!(concat!(env!("OUT_DIR"), "/COMPILER_SNAPSHOT.d.ts"));
pub static DENO_NS_LIB: &str = include_str!("js/lib.deno.ns.d.ts");
pub static SHARED_GLOBALS_LIB: &str =

View file

@ -4,36 +4,12 @@ use crate::js::COMPILER_SNAPSHOT;
use deno_core::Snapshot;
use deno_core::StartupData;
#[cfg(feature = "no-snapshot-init")]
pub fn deno_isolate_init() -> StartupData<'static> {
debug!("Deno isolate init without snapshots.");
let source =
include_str!(concat!(env!("GN_OUT_DIR"), "/gen/cli/bundle/main.js"));
StartupData::Script(deno_core::Script {
filename: "gen/cli/bundle/main.js",
source,
})
}
#[cfg(not(feature = "no-snapshot-init"))]
pub fn deno_isolate_init() -> StartupData<'static> {
debug!("Deno isolate init with snapshots.");
let data = CLI_SNAPSHOT;
StartupData::Snapshot(Snapshot::Static(data))
}
#[cfg(feature = "no-snapshot-init")]
pub fn compiler_isolate_init() -> StartupData<'static> {
debug!("Compiler isolate init without snapshots.");
let source =
include_str!(concat!(env!("GN_OUT_DIR"), "/gen/cli/bundle/compiler.js"));
StartupData::Script(deno_core::Script {
filename: "gen/cli/bundle/compiler.js",
source,
})
}
#[cfg(not(feature = "no-snapshot-init"))]
pub fn compiler_isolate_init() -> StartupData<'static> {
debug!("Deno isolate init with snapshots.");
let data = COMPILER_SNAPSHOT;