mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 02:22:40 +00:00
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.
This commit is contained in:
parent
b4af648c15
commit
8b31fc23cd
26 changed files with 290 additions and 478 deletions
|
@ -222,10 +222,6 @@ delete Object.prototype.__proto__;
|
|||
build.setBuildInfo(runtimeOptions.target);
|
||||
util.setLogDebug(runtimeOptions.debugFlag, source);
|
||||
const prepareStackTrace = core.createPrepareStackTrace(
|
||||
// TODO(bartlomieju): a very crude way to disable
|
||||
// source mapping of errors. This condition is true
|
||||
// only for compiled standalone binaries.
|
||||
runtimeOptions.applySourceMaps ? errorStack.opApplySourceMap : undefined,
|
||||
errorStack.opFormatFileName,
|
||||
);
|
||||
// deno-lint-ignore prefer-primordials
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue