[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
commit 9bd4f503f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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()