Reset framePtr on unhabdled exception. Dont reset on getStackTrace.
This commit is contained in:
parent
62785be5a5
commit
c1dd65c01a
1 changed files with 1 additions and 3 deletions
|
|
@ -86,9 +86,6 @@ proc auxWriteStackTrace(f: PCallFrame): string =
|
|||
proc rawWriteStackTrace(): string =
|
||||
if framePtr != nil:
|
||||
result = "Traceback (most recent call last)\n" & auxWriteStackTrace(framePtr)
|
||||
framePtr = nil
|
||||
elif lastJSError != nil:
|
||||
result = $lastJSError.stack
|
||||
else:
|
||||
result = "No stack traceback available\n"
|
||||
|
||||
|
|
@ -108,6 +105,7 @@ proc unhandledException(e: ref Exception) {.
|
|||
when NimStackTrace:
|
||||
add(buf, rawWriteStackTrace())
|
||||
let cbuf : cstring = buf
|
||||
framePtr = nil
|
||||
{.emit: """
|
||||
if (typeof(Error) !== "undefined") {
|
||||
throw new Error(`cbuf`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue