* fix #18620

* add testcase
This commit is contained in:
flywind 2021-08-01 17:19:43 +08:00 • committed by GitHub
commit 916d0c21af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View file

@ -524,10 +524,7 @@ proc getStackTrace(e: ref Exception): string =
proc getStackTraceEntries*(e: ref Exception): seq[StackTraceEntry] =
## Returns the attached stack trace to the exception `e` as
## a `seq`. This is not yet available for the JS backend.
when not defined(nimSeqsV2):
shallowCopy(result, e.trace)
else:
result = move(e.trace)
shallowCopy(result, e.trace)
proc getStackTraceEntries*(): seq[StackTraceEntry] =
## Returns the stack trace entries for the current stack trace.