Reset framePtr on unhabdled exception. Dont reset on getStackTrace.

This commit is contained in:
Yuriy Glukhov
2016-08-27 18:10:13 +03:00
parent 62785be5a5
commit c1dd65c01a

View File

@@ -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`);