1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-08 15:19:40 -05:00

Remove unused check-only feature (#6035)

This commit is contained in:
Ryan Dahl 2020-06-02 14:56:21 -04:00 committed by GitHub
parent 9c59a4b18c
commit b7b6e0674f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 32 deletions

View file

@ -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())

View file

@ -1,7 +1,4 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
#[cfg(feature = "no-snapshot-init")]
use deno_core::Script;
use crate::js::CLI_SNAPSHOT;
use crate::js::COMPILER_SNAPSHOT;
use deno_core::Snapshot;
@ -10,13 +7,9 @@ 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 {
StartupData::Script(deno_core::Script {
filename: "gen/cli/bundle/main.js",
source,
})
@ -25,24 +18,16 @@ 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 {
StartupData::Script(deno_core::Script {
filename: "gen/cli/bundle/compiler.js",
source,
})
@ -51,10 +36,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))
}