summaryrefslogtreecommitdiff
path: root/core/runtime.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-12-10 14:45:41 +0100
committerGitHub <noreply@github.com>2020-12-10 14:45:41 +0100
commitf91fa16661fa10fd029e6cf26008faee95233143 (patch)
tree3d45e2ebb3e93e0947ac382b944bf2600b9c36c4 /core/runtime.rs
parentb7faa27704458b4bbb0b43b15bcb16b13e7c3c4f (diff)
refactor(core): stack trace mapping (#8660)
This commit adds "Deno.core.createPrepareStackTrace". This function was moved from "cli/rt/40_error_stack.js" to unify handling of stack frames in core (before this PR there was implicit dependency on logic in "core/error.rs::JsError"). Unfortunately formatting logic must still be duplicated in "cli/error.js::PrettyJsError" to provide coloring, but currently there's no solution to this problem. "createPrepareStackTrace" can accept a single argument; a function that takes a location and provides source mapped location back.
Diffstat (limited to 'core/runtime.rs')
-rw-r--r--core/runtime.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/runtime.rs b/core/runtime.rs
index ecac588ca..0f09926f8 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -329,6 +329,9 @@ impl JsRuntime {
self
.execute("deno:core/core.js", include_str!("core.js"))
.unwrap();
+ self
+ .execute("deno:core/error.js", include_str!("error.js"))
+ .unwrap();
}
}