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 =
|
proc rawWriteStackTrace(): string =
|
||||||
if framePtr != nil:
|
if framePtr != nil:
|
||||||
result = "Traceback (most recent call last)\n" & auxWriteStackTrace(framePtr)
|
result = "Traceback (most recent call last)\n" & auxWriteStackTrace(framePtr)
|
||||||
framePtr = nil
|
|
||||||
elif lastJSError != nil:
|
|
||||||
result = $lastJSError.stack
|
|
||||||
else:
|
else:
|
||||||
result = "No stack traceback available\n"
|
result = "No stack traceback available\n"
|
||||||
|
|
||||||
|
|
@ -108,6 +105,7 @@ proc unhandledException(e: ref Exception) {.
|
||||||
when NimStackTrace:
|
when NimStackTrace:
|
||||||
add(buf, rawWriteStackTrace())
|
add(buf, rawWriteStackTrace())
|
||||||
let cbuf : cstring = buf
|
let cbuf : cstring = buf
|
||||||
|
framePtr = nil
|
||||||
{.emit: """
|
{.emit: """
|
||||||
if (typeof(Error) !== "undefined") {
|
if (typeof(Error) !== "undefined") {
|
||||||
throw new Error(`cbuf`);
|
throw new Error(`cbuf`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue