close #18129 Add setCurrentException for JS backend (#18145)

* [std/re] make interface consistent

* tiny

* revert

* close #18129  add setCurrentException

* changelog entry
This commit is contained in:
flywind 2021-06-02 00:16:25 +08:00 • committed by GitHub
commit c2e3dc0ed1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,8 @@
discard """
targets: "c cpp js"
"""
let ex = newException(CatchableError, "test")
setCurrentException(ex)
doAssert getCurrentException().msg == ex.msg
doAssert getCurrentExceptionMsg() == ex.msg