diff options
author | Oscar NihlgÄrd <oscarnihlgard@gmail.com> | 2019-10-24 11:17:01 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-10-24 11:17:01 +0200 |
commit | 4ac100c9122231ce82f56b51f86ee6e906e0b389 (patch) | |
tree | b73fb4483d849dd112bf79e54696251abb5f3042 /tests | |
parent | 9ccfcf5dd2572c858913cf092a6a571a5e4a8df0 (diff) | |
download | Nim-4ac100c9122231ce82f56b51f86ee6e906e0b389.tar.gz |
Fix jsgen bug with uninitialized seq (#12500) [backport]
Diffstat (limited to 'tests')
-rw-r--r-- | tests/js/t12223.nim | 20 |
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 |