summaryrefslogtreecommitdiff
path: root/cli/source_maps.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-11-19 20:37:22 +0100
committerGitHub <noreply@github.com>2020-11-19 20:37:22 +0100
commite582796f42b96a940cba757a8a08573bc61aca0c (patch)
tree66796ba77c195359fc61d149fe3de55dd593afaa /cli/source_maps.rs
parent9eaa1fb71d03679367ebca0e0361fa0e47a1274f (diff)
refactor(cli): rename fmt_errors::JsError to PrettyJsError (#8435)
This commit renames "fmt_errors::JsError" to "PrettyJsError" to avoid confusion with "deno_core::JsError". Consequently "CoreJsError" aliases to "deno_core::JsError" were removed. Additionally source mapping step has been removed from "PrettyJsError::create" to better separate domains.
Diffstat (limited to 'cli/source_maps.rs')
-rw-r--r--cli/source_maps.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/source_maps.rs b/cli/source_maps.rs
index f31228bdc..318665e9d 100644
--- a/cli/source_maps.rs
+++ b/cli/source_maps.rs
@@ -2,7 +2,7 @@
//! This mod provides functions to remap a `JsError` based on a source map.
-use deno_core::error::JsError as CoreJsError;
+use deno_core::error::JsError;
use sourcemap::SourceMap;
use std::collections::HashMap;
use std::str;
@@ -26,9 +26,9 @@ pub type CachedMaps = HashMap<String, Option<SourceMap>>;
/// file names and line/column numbers point to the location in the original
/// source, rather than the transpiled source code.
pub fn apply_source_map<G: SourceMapGetter>(
- js_error: &CoreJsError,
+ js_error: &JsError,
getter: Arc<G>,
-) -> CoreJsError {
+) -> JsError {
// Note that js_error.frames has already been source mapped in
// prepareStackTrace().
let mut mappings_map: CachedMaps = HashMap::new();
@@ -71,7 +71,7 @@ pub fn apply_source_map<G: SourceMapGetter>(
_ => js_error.source_line.clone(),
};
- CoreJsError {
+ JsError {
message: js_error.message.clone(),
source_line,
script_resource_name,
@@ -198,7 +198,7 @@ mod tests {
#[test]
fn apply_source_map_line() {
- let e = CoreJsError {
+ let e = JsError {
message: "TypeError: baz".to_string(),
source_line: Some("foo".to_string()),
script_resource_name: Some("foo_bar.ts".to_string()),