diff options
Diffstat (limited to 'tests/js/tasync.nim')
-rw-r--r-- | tests/js/tasync.nim | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/js/tasync.nim b/tests/js/tasync.nim index a164827d2..8cc972a62 100644 --- a/tests/js/tasync.nim +++ b/tests/js/tasync.nim @@ -3,6 +3,7 @@ discard """ output: ''' 0 x +e ''' """ @@ -12,15 +13,19 @@ import asyncjs # for js proc y(e: int): Future[string] -proc x(e: int) {.async.} = +proc e: int {.discardable.} = + echo "e" + return 2 + +proc x(e: int): Future[void] {.async.} = var s = await y(e) echo s + e() proc y(e: int): Future[string] {.async.} = echo 0 return "x" - discard x(2) |