summaryrefslogtreecommitdiff
path: root/tests/testdata/run/error_021_stack_method.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testdata/run/error_021_stack_method.ts')
-rw-r--r--tests/testdata/run/error_021_stack_method.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/testdata/run/error_021_stack_method.ts b/tests/testdata/run/error_021_stack_method.ts
new file mode 100644
index 000000000..b6ebe1f5e
--- /dev/null
+++ b/tests/testdata/run/error_021_stack_method.ts
@@ -0,0 +1,14 @@
+class A {
+ m(): never {
+ throw new Error("method");
+ }
+}
+
+try {
+ new A().m();
+} catch (error) {
+ if (error instanceof Error) {
+ console.log(error.stack);
+ }
+ throw error;
+}