Fix jsgen bug with uninitialized seq (#12500) [backport]
This commit is contained in:
parent
9ccfcf5dd2
commit
4ac100c912
2 changed files with 21 additions and 1 deletions
20
tests/js/t12223.nim
Normal file
20
tests/js/t12223.nim
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue