diff options
-rw-r--r-- | lib/system/jssys.nim | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim index 4d5ba1f73..5a9333a0e 100644 --- a/lib/system/jssys.nim +++ b/lib/system/jssys.nim @@ -114,19 +114,21 @@ proc unhandledException(e: ref Exception) {. proc raiseException(e: ref Exception, ename: cstring) {. compilerproc, asmNoStackFrame.} = e.name = ename - if excHandler == 0: - unhandledException(e) + when not defined(noUnhandledHandler): + if excHandler == 0: + unhandledException(e) asm "throw `e`;" proc reraiseException() {.compilerproc, asmNoStackFrame.} = if lastJSError == nil: raise newException(ReraiseError, "no exception to reraise") else: - if excHandler == 0: - var isNimException : bool - asm "`isNimException` = lastJSError.m_type;" - if isNimException: - unhandledException(cast[ref Exception](lastJSError)) + when not defined(noUnhandledHandler): + if excHandler == 0: + var isNimException : bool + asm "`isNimException` = lastJSError.m_type;" + if isNimException: + unhandledException(cast[ref Exception](lastJSError)) asm "throw lastJSError;" proc raiseOverflow {.exportc: "raiseOverflow", noreturn.} = |