summary refs log tree commit diff stats
path: root/tests/js
diff options
context:
space:
mode:
authorAlexander Ivanov <alehander42@gmail.com>2017-12-19 13:57:37 +0200
committerAlexander Ivanov <alehander42@gmail.com>2017-12-19 13:57:37 +0200
commit7f6afa9e9b554799cf9a39d0f8cc7d35e47a2cb4 (patch)
treec8be829b63bb8694fdffb3be4cfa6493b3634a9e /tests/js
parent85ac3130aa80e784fcd84c5a38122c61f4a8860d (diff)
downloadNim-7f6afa9e9b554799cf9a39d0f8cc7d35e47a2cb4.tar.gz
Make asyncjs Future[void] play nicely with last line discardable calls
Diffstat (limited to 'tests/js')
-rw-r--r--tests/js/tasync.nim9
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)