summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-06-02 00:16:25 +0800
committerGitHub <noreply@github.com>2021-06-01 18:16:25 +0200
commitc2e3dc0ed16a854981769b426e9e327663447df7 (patch)
tree9bf99b1fd1fbddd25cf2972146000d29a012d089 /tests
parentc0e8199acc9f49caa36bae34d103600d112b66f3 (diff)
downloadNim-c2e3dc0ed16a854981769b426e9e327663447df7.tar.gz
close #18129 Add setCurrentException for JS backend (#18145)
* [std/re] make interface consistent

* tiny

* revert

* close #18129  add setCurrentException

* changelog entry
Diffstat (limited to 'tests')
-rw-r--r--tests/exception/tsetexceptions.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/exception/tsetexceptions.nim b/tests/exception/tsetexceptions.nim
new file mode 100644
index 000000000..557fc1898
--- /dev/null
+++ b/tests/exception/tsetexceptions.nim
@@ -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