summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-09-04 23:46:01 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-09-04 23:46:01 +0200
commit147c2577200306317b5ba52335293a07b6111444 (patch)
tree85452ff91a8eeb5cebe0a09b2c30480f7914db0b
parenta756b005acb40a832f1f445f7fad312b336384f5 (diff)
parente6e53549fe2d7347ddbc97fdce2a83a08fa9ca44 (diff)
downloadNim-147c2577200306317b5ba52335293a07b6111444.tar.gz
Merge branch 'devel' of github.com:nim-lang/Nim into devel
-rw-r--r--lib/system/jssys.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim
index 31d283cd7..39ce1183b 100644
--- a/lib/system/jssys.nim
+++ b/lib/system/jssys.nim
@@ -109,6 +109,7 @@ proc rawWriteStackTrace(): string =
     result = "No stack traceback available\n"
 
 proc getStackTrace*(): string = rawWriteStackTrace()
+proc getStackTrace*(e: ref Exception): string = e.trace
 
 proc unhandledException(e: ref Exception) {.
     compilerproc, asmNoStackFrame.} =
@@ -142,6 +143,8 @@ proc raiseException(e: ref Exception, ename: cstring) {.
   when defined(nimphp):
     asm """throw new Exception($`e`["message"]);"""
   else:
+    when NimStackTrace:
+      e.trace = rawWriteStackTrace()
     asm "throw `e`;"
 
 proc reraiseException() {.compilerproc, asmNoStackFrame.} =