summaryrefslogtreecommitdiff
path: root/cli/tools/coverage
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2022-04-15 15:08:09 +0100
committerGitHub <noreply@github.com>2022-04-15 16:08:09 +0200
commit8b31fc23cd80de9baa62535e95367da7a21c9cfd (patch)
tree994748bd06ed5b4953929392107b6beaa1c1c337 /cli/tools/coverage
parentb4af648c1515a8e79d7a5d1b14d8a4ba9d966a72 (diff)
refactor: Move source map lookups to core (#14274)
The following transformations gradually faced by "JsError" have all been moved up front to "JsError::from_v8_exception()": - finding the first non-"deno:" source line; - moving "JsError::script_resource_name" etc. into the first error stack in case of syntax errors; - source mapping "JsError::script_resource_name" etc. when wrapping the error even though the frame locations are source mapped earlier; - removing "JsError::{script_resource_name,line_number,start_column,end_column}" entirely in favour of "js_error.frames.get(0)". We also no longer pass a js-side callback to "core/02_error.js" from cli. I avoided doing this on previous occasions because the source map lookups were in an awkward place.
Diffstat (limited to 'cli/tools/coverage')
-rw-r--r--cli/tools/coverage/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/tools/coverage/mod.rs b/cli/tools/coverage/mod.rs
index 092f6c825..338779583 100644
--- a/cli/tools/coverage/mod.rs
+++ b/cli/tools/coverage/mod.rs
@@ -5,7 +5,6 @@ use crate::flags::CoverageFlags;
use crate::flags::Flags;
use crate::fs_util::collect_files;
use crate::proc_state::ProcState;
-use crate::source_maps::SourceMapGetter;
use crate::tools::fmt::format_json;
use deno_ast::MediaType;
@@ -14,10 +13,11 @@ use deno_core::anyhow::anyhow;
use deno_core::anyhow::Context;
use deno_core::error::AnyError;
use deno_core::serde_json;
+use deno_core::sourcemap::SourceMap;
use deno_core::url::Url;
use deno_core::LocalInspectorSession;
+use deno_core::SourceMapGetter;
use regex::Regex;
-use sourcemap::SourceMap;
use std::fs;
use std::fs::File;
use std::io::BufWriter;