Fix jsgen bug with uninitialized seq (#12500) [backport]

This commit is contained in:
Oscar Nihlgård 2019-10-24 11:17:01 +02:00 • committed by Andreas Rumpf
commit 4ac100c912
2 changed files with 21 additions and 1 deletions

20
tests/js/t12223.nim Normal file
View file

@ -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()