(cherry picked from commit 7af4e3eefd)
This commit is contained in:
Yuriy Glukhov
2025-10-28 12:48:22 +01:00
committed by narimiran
parent 3bbba9e0ff
commit 365da2cb97
5 changed files with 154 additions and 78 deletions

View File

@@ -24,6 +24,7 @@ when not gotoBasedExceptions:
proc popSafePoint {.compilerRtl, inl.} = discard
proc pushCurrentException(e: ref Exception) {.compilerRtl, inl.} = discard
proc popCurrentException {.compilerRtl, inl.} = discard
proc closureIterSetExc(e: ref Exception) {.compilerRtl, inl.} = discard
# some platforms have native support for stack traces:
const

View File

@@ -159,6 +159,9 @@ proc popCurrentException {.compilerRtl, inl.} =
currException = currException.up
#showErrorMessage2 "B"
proc closureIterSetExc(e: ref Exception) {.compilerRtl, inl.} =
currException = e
proc popCurrentExceptionEx(id: uint) {.compilerRtl.} =
discard "only for bootstrapping compatbility"

View File

@@ -72,6 +72,9 @@ proc getCurrentExceptionMsg*(): string =
proc setCurrentException*(exc: ref Exception) =
lastJSError = cast[PJSError](exc)
proc closureIterSetExc(e: ref Exception) {.compilerRtl, benign.} =
setCurrentException(e)
proc pushCurrentException(e: sink(ref Exception)) {.compilerRtl, inline.} =
## Used to set up exception handling for closure iterators.