summary refs log tree commit diff stats
path: root/tests/js
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-11-25 02:45:06 +0800
committerGitHub <noreply@github.com>2020-11-24 19:45:06 +0100
commit19e224866ba6cfe2c6cdc49e435a275b532f0acb (patch)
tree2bccf626f783314e09b6f940f5a0ddee60b02454 /tests/js
parent3fed85437b981a01cc368166841d9d89d99434f0 (diff)
downloadNim-19e224866ba6cfe2c6cdc49e435a275b532f0acb.tar.gz
add simple writeStackTrace for JS backend (#16016)
* add simple writeStackTrace for JS backend

* add testcase for writeStackTrace

* changelog
Diffstat (limited to 'tests/js')
-rw-r--r--tests/js/twritestacktrace.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/js/twritestacktrace.nim b/tests/js/twritestacktrace.nim
new file mode 100644
index 000000000..2fe2b1987
--- /dev/null
+++ b/tests/js/twritestacktrace.nim
@@ -0,0 +1,12 @@
+discard """
+  cmd: "nim js --panics:on $file"
+  output: '''Traceback (most recent call last)
+twritestacktrace.nim(12) at module twritestacktrace
+twritestacktrace.nim(10) at twritestacktrace.hello
+'''
+"""
+
+proc hello() =
+  writeStackTrace()
+
+hello()