From 20a89d46c4af091f30daf0df20b12c91962f9b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 30 Jul 2022 16:09:42 +0200 Subject: fix(core): BorrowMutError in nested error (#15352) --- cli/tests/integration/run_tests.rs | 6 ++++++ cli/tests/testdata/nested_error.ts | 3 +++ cli/tests/testdata/nested_error.ts.out | 4 ++++ 3 files changed, 13 insertions(+) create mode 100644 cli/tests/testdata/nested_error.ts create mode 100644 cli/tests/testdata/nested_error.ts.out (limited to 'cli') diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 29e424aae..7354dbf1d 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2792,3 +2792,9 @@ itest!(unhandled_rejection_sync_error { args: "run --check unhandled_rejection_sync_error.ts", output: "unhandled_rejection_sync_error.ts.out", }); + +itest!(nested_error { + args: "run nested_error.ts", + output: "nested_error.ts.out", + exit_code: 1, +}); diff --git a/cli/tests/testdata/nested_error.ts b/cli/tests/testdata/nested_error.ts new file mode 100644 index 000000000..69828e1ca --- /dev/null +++ b/cli/tests/testdata/nested_error.ts @@ -0,0 +1,3 @@ +throw { + foo: new Error(), +}; diff --git a/cli/tests/testdata/nested_error.ts.out b/cli/tests/testdata/nested_error.ts.out new file mode 100644 index 000000000..042a179ff --- /dev/null +++ b/cli/tests/testdata/nested_error.ts.out @@ -0,0 +1,4 @@ +error: Uncaught { + foo: Error + at file:///[WILDCARD]testdata/nested_error.ts:2:8 +} -- cgit v1.2.3