diff options
Diffstat (limited to 'tests/testdata/run/error_020_stack_constructor.ts')
-rw-r--r-- | tests/testdata/run/error_020_stack_constructor.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/testdata/run/error_020_stack_constructor.ts b/tests/testdata/run/error_020_stack_constructor.ts new file mode 100644 index 000000000..526d1a661 --- /dev/null +++ b/tests/testdata/run/error_020_stack_constructor.ts @@ -0,0 +1,14 @@ +class A { + constructor() { + throw new Error("constructor"); + } +} + +try { + new A(); +} catch (error) { + if (error instanceof Error) { + console.log(error.stack); + } + throw error; +} |