[JS] Ref #15952 make toOpenArray works better (#17001)

* ref 15952 toOpenArray works in JS

* fix
This commit is contained in:
flywind
2021-02-10 11:49:44 -06:00
committed by GitHub
parent 216be4060a
commit 9bd4f503f4
2 changed files with 32 additions and 10 deletions

View File

@@ -0,0 +1,13 @@
discard """
targets: "c cpp js"
"""
proc pro[T](a: var openArray[T]) = discard
proc main =
var a = [1,2,3,4,5]
pro(toOpenArray(a, 1, 3))
pro(a.toOpenArray(1,3))
main()