diff options
Diffstat (limited to 'tests/testdata/run/error_019_stack_function.ts')
-rw-r--r-- | tests/testdata/run/error_019_stack_function.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/testdata/run/error_019_stack_function.ts b/tests/testdata/run/error_019_stack_function.ts new file mode 100644 index 000000000..a6a69d146 --- /dev/null +++ b/tests/testdata/run/error_019_stack_function.ts @@ -0,0 +1,12 @@ +function foo(): never { + throw new Error("function"); +} + +try { + foo(); +} catch (error) { + if (error instanceof Error) { + console.log(error.stack); + } + throw error; +} |