summaryrefslogtreecommitdiff
path: root/cli/source_maps.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-07-19 19:49:44 +0200
committerGitHub <noreply@github.com>2020-07-19 19:49:44 +0200
commitfa61956f03491101b6ef64423ea2f1f73af26a73 (patch)
treec3800702071ca78aa4dd71bdd0a59a9bbe460bdd /cli/source_maps.rs
parent53adde866dd399aa2509d14508642fce37afb8f5 (diff)
Port internal TS code to JS (#6793)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'cli/source_maps.rs')
-rw-r--r--cli/source_maps.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/cli/source_maps.rs b/cli/source_maps.rs
index d87147dbe..c42d3edc9 100644
--- a/cli/source_maps.rs
+++ b/cli/source_maps.rs
@@ -18,16 +18,6 @@ pub trait SourceMapGetter {
/// find a SourceMap.
pub type CachedMaps = HashMap<String, Option<SourceMap>>;
-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())
- } else if file_name.ends_with("COMPILER_SNAPSHOT.js") {
- Some(crate::js::COMPILER_SNAPSHOT_MAP.to_vec())
- } else {
- None
- }
-}
-
/// Apply a source map to a deno_core::JSError, returning a JSError where file
/// names and line/column numbers point to the location in the original source,
/// rather than the transpiled source code.
@@ -154,8 +144,8 @@ fn parse_map_string<G: SourceMapGetter>(
file_name: &str,
getter: &G,
) -> Option<SourceMap> {
- builtin_source_map(file_name)
- .or_else(|| getter.get_source_map(file_name))
+ getter
+ .get_source_map(file_name)
.and_then(|raw_source_map| SourceMap::from_slice(&raw_source_map).ok())
}