Nim/tests/js/tasync.nim
2017-12-19 00:34:54 +01:00

26 lines
286 B
Nim

discard """
disabled: true
output: '''
0
x
'''
"""
import asyncjs
# demonstrate forward definition
# for js
proc y(e: int): Future[string]
proc x(e: int) {.async.} =
var s = await y(e)
echo s
proc y(e: int): Future[string] {.async.} =
echo 0
return "x"
discard x(2)