diff options
Diffstat (limited to 'tests/js/tclosures.nim')
-rw-r--r-- | tests/js/tclosures.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/js/tclosures.nim b/tests/js/tclosures.nim index 70037f4bf..4f1c28de3 100644 --- a/tests/js/tclosures.nim +++ b/tests/js/tclosures.nim @@ -2,7 +2,7 @@ discard """ action: run """ -import math, random, strutils +import random, strutils const consolePrefix = "jsCallbacks" asm """ @@ -22,7 +22,7 @@ asm """ function print (text) { console.log (text); } """ -proc consoleprint (str:cstring): void {.importc: "print", noDecl.} +proc consoleprint (str:cstring): void {.importc: "print", nodecl.} proc print* (a: varargs[string, `$`]) = consoleprint "$1: $2" % [consolePrefix, join(a, " ")] type CallbackProc {.importc.} = proc () : cstring @@ -33,8 +33,8 @@ proc runCallbacks ():cstring {.importc.} proc `*` (s:string, n:Natural) : string = s.repeat(n) proc outer (i:Natural) : (string, int) = - let c = $char(random(93) + 33) - let n = random(40) + let c = $char(rand(93) + 33) + let n = rand(40) let s = c * n proc inner(): cstring = ("[$1]" % $n) & s & " <--" regCallback(inner) @@ -92,4 +92,4 @@ block issue7048: let f = foo(p) p = addr s2 doAssert len(p[]) == 5 - doAssert f() == 3 \ No newline at end of file + doAssert f() == 3 |