From cb9110c43d4ae9c29a0a1e0d54f7735712d4ba62 Mon Sep 17 00:00:00 2001
From: Andreas Rumpf <rumpf_a@web.de>
Date: Thu, 3 Jan 2019 18:56:05 +0100
Subject: --define:nimQuirky exception handling for Nim; in preparation of a
 blog post

---
 lib/system/excpt.nim | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'lib/system/excpt.nim')

diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim
index 84a1da343..3c0e42c6e 100644
--- a/lib/system/excpt.nim
+++ b/lib/system/excpt.nim
@@ -357,6 +357,8 @@ proc raiseExceptionAux(e: ref Exception) =
         raiseCounter.inc # skip zero at overflow
       e.raiseId = raiseCounter
       {.emit: "`e`->raise();".}
+  elif defined(nimQuirky):
+    if currException == nil: currException = e
   else:
     if excHandler != nil:
       if not excHandler.hasRaiseAction or excHandler.raiseAction(e):
-- 
cgit 1.4.1-2-gfad0