From 8b31fc23cd80de9baa62535e95367da7a21c9cfd Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Fri, 15 Apr 2022 15:08:09 +0100 Subject: 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. --- runtime/examples/hello_runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/examples/hello_runtime.rs') diff --git a/runtime/examples/hello_runtime.rs b/runtime/examples/hello_runtime.rs index 0a0d6fe23..b4716076e 100644 --- a/runtime/examples/hello_runtime.rs +++ b/runtime/examples/hello_runtime.rs @@ -28,7 +28,6 @@ async fn main() -> Result<(), AnyError> { let options = WorkerOptions { bootstrap: BootstrapOptions { - apply_source_maps: false, args: vec![], cpu_count: 1, debug_flag: false, @@ -45,6 +44,7 @@ async fn main() -> Result<(), AnyError> { root_cert_store: None, user_agent: "hello_runtime".to_string(), seed: None, + source_map_getter: None, js_error_create_fn: None, web_worker_preload_module_cb, create_web_worker_cb, -- cgit v1.2.3