Skip to content

Commit

Permalink
Remove unused check-only feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jun 1, 2020
1 parent 40419c6 commit e83826d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
11 changes: 0 additions & 11 deletions cli/source_maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,6 @@ pub trait SourceMapGetter {
/// find a SourceMap.
pub type CachedMaps = HashMap<String, Option<SourceMap>>;

// The bundle does not get built for 'cargo check', so we don't embed the
// bundle source map. The built in source map is the source map for the main
// JavaScript bundle which is then used to create the snapshot. Runtime stack
// traces can contain positions within the bundle which we will map to the
// original Deno TypeScript code.
#[cfg(feature = "check-only")]
fn builtin_source_map(_: &str) -> Option<Vec<u8>> {
None
}

#[cfg(not(feature = "check-only"))]
fn builtin_source_map(file_name: &str) -> Option<Vec<u8>> {
if file_name.ends_with("CLI_SNAPSHOT.js") {
Some(crate::js::CLI_SNAPSHOT_MAP.to_vec())
Expand Down
16 changes: 0 additions & 16 deletions cli/startup_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ use deno_core::StartupData;
#[cfg(feature = "no-snapshot-init")]
pub fn deno_isolate_init() -> StartupData<'static> {
debug!("Deno isolate init without snapshots.");
#[cfg(not(feature = "check-only"))]
let source =
include_str!(concat!(env!("GN_OUT_DIR"), "/gen/cli/bundle/main.js"));
#[cfg(feature = "check-only")]
let source = "";

StartupData::Script(Script {
filename: "gen/cli/bundle/main.js",
source,
Expand All @@ -25,23 +21,15 @@ pub fn deno_isolate_init() -> StartupData<'static> {
#[cfg(not(feature = "no-snapshot-init"))]
pub fn deno_isolate_init() -> StartupData<'static> {
debug!("Deno isolate init with snapshots.");
#[cfg(not(feature = "check-only"))]
let data = CLI_SNAPSHOT;
#[cfg(feature = "check-only")]
let data = b"";

StartupData::Snapshot(Snapshot::Static(data))
}

#[cfg(feature = "no-snapshot-init")]
pub fn compiler_isolate_init() -> StartupData<'static> {
debug!("Compiler isolate init without snapshots.");
#[cfg(not(feature = "check-only"))]
let source =
include_str!(concat!(env!("GN_OUT_DIR"), "/gen/cli/bundle/compiler.js"));
#[cfg(feature = "check-only")]
let source = "";

StartupData::Script(Script {
filename: "gen/cli/bundle/compiler.js",
source,
Expand All @@ -51,10 +39,6 @@ pub fn compiler_isolate_init() -> StartupData<'static> {
#[cfg(not(feature = "no-snapshot-init"))]
pub fn compiler_isolate_init() -> StartupData<'static> {
debug!("Deno isolate init with snapshots.");
#[cfg(not(feature = "check-only"))]
let data = COMPILER_SNAPSHOT;
#[cfg(feature = "check-only")]
let data = b"";

StartupData::Snapshot(Snapshot::Static(data))
}

0 comments on commit e83826d

Please sign in to comment.