Reduce the scope of stackTrace var (#5583)

Fixes #5571.
This commit is contained in:
Ruslan Mustakov 2017-03-22 07:06:05 +07:00 • committed by Andreas Rumpf
commit 310b73b556
2 changed files with 8 additions and 2 deletions

View file

@ -375,7 +375,6 @@ template test*(name, body) {.dirty.} =
ensureFormattersInitialized()
if shouldRun(name):
var stackTrace {.inject.}: string
checkpoints = @[]
var testStatusIMPL {.inject.} = OK
@ -391,7 +390,7 @@ template test*(name, body) {.dirty.} =
except:
when not defined(js):
checkpoint("Unhandled exception: " & getCurrentExceptionMsg())
stackTrace = getCurrentException().getStackTrace()
var stackTrace {.inject.} = getCurrentException().getStackTrace()
fail()
finally: