summaryrefslogtreecommitdiff
path: root/test/fixtures/source-map/typescript-throw.ts
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixtures/source-map/typescript-throw.ts')
-rw-r--r--test/fixtures/source-map/typescript-throw.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/fixtures/source-map/typescript-throw.ts b/test/fixtures/source-map/typescript-throw.ts
new file mode 100644
index 0000000000..befb58fe0a
--- /dev/null
+++ b/test/fixtures/source-map/typescript-throw.ts
@@ -0,0 +1,24 @@
+enum ATrue {
+ IsTrue = 1,
+ IsFalse = 0
+}
+
+if (false) {
+ console.info('unreachable')
+} else if (true) {
+ console.info('reachable')
+} else {
+ console.info('unreachable')
+}
+
+function branch (a: ATrue) {
+ if (a === ATrue.IsFalse) {
+ console.info('a = false')
+ } else if (a === ATrue.IsTrue) {
+ throw Error('an exception');
+ } else {
+ console.info('a = ???')
+ }
+}
+
+branch(ATrue.IsTrue)