implement system.default for the JS target

This commit is contained in:
Andreas Rumpf 2019-03-05 19:44:17 +01:00
commit 1c64934f46
2 changed files with 30 additions and 11 deletions

View file

@ -46,3 +46,17 @@ proc test2 =
echo int(val)
test2()
var someGlobal = default(array[5, int])
for x in someGlobal: doAssert(x == 0)
proc tdefault =
var x = default(int)
doAssert(x == 0)
proc inner(v: openarray[string]) =
doAssert(v.len == 0)
inner(default(seq[string]))
tdefault()