summaryrefslogtreecommitdiff
path: root/tests/testdata/run/error_020_stack_constructor.ts
blob: 526d1a661f9f4ac13ee51f5546d6dc76d93ca81d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class A {
  constructor() {
    throw new Error("constructor");
  }
}

try {
  new A();
} catch (error) {
  if (error instanceof Error) {
    console.log(error.stack);
  }
  throw error;
}