std/asyncjs allow transforming proc types (#21356)

* Add test case

* Implement JS async transform for nnkProcTy
This commit is contained in:
Jake Leahy 2023-02-14 18:14:19 +11:00 • committed by GitHub
commit cac49694c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -94,4 +94,9 @@ proc main() {.async.} =
doAssert "foobar: 7" in $reason.message
echo "done" # justified here to make sure we're running this, since it's inside `async`
block asyncPragmaInType:
type Handler = proc () {.async.}
proc foo() {.async.} = discard
var x: Handler = foo
discard main()