diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2021-10-18 17:05:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-18 18:05:36 +0200 |
commit | 5a48d41bddf599b14dd9019ff49821c436ce4542 (patch) | |
tree | 00fa6bd6d23bb3ec7548e2dbc7cdfdf41f2b2e74 /cli/tests/testdata/eval_context_throw_with_conflicting_source.ts | |
parent | 0a7ba33ed13450af031503a1060389037c509ea3 (diff) |
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.
Diffstat (limited to 'cli/tests/testdata/eval_context_throw_with_conflicting_source.ts')
-rw-r--r-- | cli/tests/testdata/eval_context_throw_with_conflicting_source.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/tests/testdata/eval_context_throw_with_conflicting_source.ts b/cli/tests/testdata/eval_context_throw_with_conflicting_source.ts new file mode 100644 index 000000000..c5bc21e48 --- /dev/null +++ b/cli/tests/testdata/eval_context_throw_with_conflicting_source.ts @@ -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; |