summaryrefslogtreecommitdiff
path: root/tests/testdata/run/error_019_stack_function.ts
blob: a6a69d146e67291c613fd67ce5faa99409c0fb16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
function foo(): never {
  throw new Error("function");
}

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