mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-11 22:08:54 +00:00
Don't recurse into inner functions during asyncjs transform (#23036)
Closes #13341
This commit is contained in:
@@ -90,6 +90,8 @@ proc replaceReturn(node: var NimNode) =
|
||||
node[z] = nnkReturnStmt.newTree(value)
|
||||
elif son.kind == nnkAsgn and son[0].kind == nnkIdent and $son[0] == "result":
|
||||
node[z] = nnkAsgn.newTree(son[0], nnkCall.newTree(jsResolve, son[1]))
|
||||
elif son.kind in RoutineNodes:
|
||||
discard
|
||||
else:
|
||||
replaceReturn(son)
|
||||
inc z
|
||||
|
||||
@@ -99,4 +99,9 @@ block asyncPragmaInType:
|
||||
proc foo() {.async.} = discard
|
||||
var x: Handler = foo
|
||||
|
||||
block: # 13341
|
||||
proc f {.async.} =
|
||||
proc g: int =
|
||||
result = 123
|
||||
|
||||
discard main()
|
||||
|
||||
Reference in New Issue
Block a user