summary refs log tree commit diff stats
path: root/tests/js/tasync.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/js/tasync.nim')
-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)
 
Agaram <vc@akkartik.com> 2015-07-13 22:50:49 -0700 1780 - now we always reclaim local scopes' href='/akkartik/mu/commit/factorial.mu?h=main&id=77d5b5d658830bd24724f945e0d6ddf6a06adc0e'>77d5b5d6 ^
32241605 ^
b96af395 ^

ce87c19e ^

1ead3562 ^
08b48a8d ^
c1d92c9d ^
ce87c19e ^

32241605 ^
b96af395 ^
08b48a8d ^
b96af395 ^


bc643692 ^
b96af395 ^
bafc7192 ^
b96af395 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33