add simple writeStackTrace for JS backend (#16016)
* add simple writeStackTrace for JS backend * add testcase for writeStackTrace * changelog
This commit is contained in:
parent
3fed85437b
commit
19e224866b
4 changed files with 20 additions and 1 deletions
|
|
@ -105,6 +105,11 @@ proc rawWriteStackTrace(): string =
|
|||
else:
|
||||
result = "No stack traceback available\n"
|
||||
|
||||
proc writeStackTrace() =
|
||||
var trace = rawWriteStackTrace()
|
||||
trace.setLen(trace.len - 1)
|
||||
echo trace
|
||||
|
||||
proc getStackTrace*(): string = rawWriteStackTrace()
|
||||
proc getStackTrace*(e: ref Exception): string = e.trace
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue