mirror of
https://github.com/denoland/deno.git
synced 2025-10-03 15:44:36 +00:00
fix(cli/fmt_errors): don't panic on source line formatting errors (#12449)
Returns empty values in case of errors, source lines are non-essential anyway. These errors can happen e.g. when source files change at runtime. A warning is also printed to help us track when it happens in unexpected cases besides this.
This commit is contained in:
parent
0a7ba33ed1
commit
5a48d41bdd
6 changed files with 36 additions and 2 deletions
6
cli/tests/testdata/eval_context_throw_with_conflicting_source.ts
vendored
Normal file
6
cli/tests/testdata/eval_context_throw_with_conflicting_source.ts
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
// deno-lint-ignore no-explicit-any
|
||||
const [, errorInfo] = (Deno as any).core.evalContext(
|
||||
'/* aaaaaaaaaaaaaaaaa */ throw new Error("foo")',
|
||||
new URL("eval_context_conflicting_source.ts", import.meta.url).href,
|
||||
);
|
||||
throw errorInfo.thrown;
|
Loading…
Add table
Add a link
Reference in a new issue