From a065604155991dbf4417b606d4562d275cd8955f Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Thu, 28 Oct 2021 08:43:40 +1100 Subject: feat(cli): enable `useUnknownInCatchVariables` by default (#12547) Closes #11826 **BREAKING CHANGE** this behaviour was disable when introduced in Deno 1.14/TypeScript 4.4. It will highlight code that unsafely handles variables that are caught, and will cause type errors in unsafe code. --- cli/tests/testdata/error_021_stack_method.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cli/tests/testdata/error_021_stack_method.ts') diff --git a/cli/tests/testdata/error_021_stack_method.ts b/cli/tests/testdata/error_021_stack_method.ts index a52d00deb..b6ebe1f5e 100644 --- a/cli/tests/testdata/error_021_stack_method.ts +++ b/cli/tests/testdata/error_021_stack_method.ts @@ -7,6 +7,8 @@ class A { try { new A().m(); } catch (error) { - console.log(error.stack); + if (error instanceof Error) { + console.log(error.stack); + } throw error; } -- cgit v1.2.3