summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/js/t12223.nim20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/js/t12223.nim b/tests/js/t12223.nim
new file mode 100644
index 000000000..c0e75fb44
--- /dev/null
+++ b/tests/js/t12223.nim
@@ -0,0 +1,20 @@
+discard """
+  action: "run"
+  output: '''
+caught
+index out of bounds, the container is empty
+'''
+"""
+
+proc fun() =
+  var z: seq[string]
+  discard z[4]
+
+proc main()=
+  try:
+    fun()
+  except Exception as e:
+    echo "caught"
+    echo getCurrentExceptionMsg()
+
+main()
\ No newline at end of file