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

* ref 15952 toOpenArray works in JS

* fix

(cherry picked from commit 9bd4f503f4)
This commit is contained in:
flywind
2021-02-10 11:49:44 -06:00
committed by narimiran
parent 8d7e1c4649
commit 8f9ea358b6
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()