summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlexander Ivanov <alehander42@gmail.com>2017-12-20 14:09:02 +0200
committerAlexander Ivanov <alehander42@gmail.com>2017-12-20 14:09:02 +0200
commit7b495e23d453c6528c9eee3ac8ae6982744ef403 (patch)
tree670b8e5397ccdc1580bf55a961c6cc4a543ceec5
parentb3dfc93beee2ac47a907ea77c1ed2da84ba4b672 (diff)
downloadNim-7b495e23d453c6528c9eee3ac8ae6982744ef403.tar.gz
Fix the forward test
-rw-r--r--tests/js/tasync.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/js/tasync.nim b/tests/js/tasync.nim
index 8cc972a62..34ef97b8b 100644
--- a/tests/js/tasync.nim
+++ b/tests/js/tasync.nim
@@ -1,7 +1,6 @@
 discard """
   disabled: true
   output: '''
-0
 x
 e
 '''
@@ -11,7 +10,7 @@ import asyncjs
 
 # demonstrate forward definition
 # for js
-proc y(e: int): Future[string]
+proc y(e: int): Future[string] {.async.}
 
 proc e: int {.discardable.} =
   echo "e"
@@ -23,8 +22,10 @@ proc x(e: int): Future[void] {.async.} =
   e()
 
 proc y(e: int): Future[string] {.async.} =
-  echo 0
-  return "x"
+  if e > 0:
+    return await y(0)
+  else:
+    return "x"
 
 
 discard x(2)