JS backend properly extends string with setLen (#21087)
* Add test case * Extend string with '0' when setting length to be longer
This commit is contained in:
parent
1fefb8e92a
commit
7ae7832f76
2 changed files with 14 additions and 1 deletions
11
tests/js/t20235.nim
Normal file
11
tests/js/t20235.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
discard """
|
||||
action: "run"
|
||||
output: "0 4"
|
||||
"""
|
||||
|
||||
proc main =
|
||||
var s = ""
|
||||
s.setLen(4)
|
||||
echo s[0].ord, " ", s.len
|
||||
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue