Added noUnhandledHandler

This commit is contained in:
yglukhov 2015-06-15 23:30:09 +03:00
commit ffa4f8dc99

View file

@ -114,6 +114,7 @@ proc unhandledException(e: ref Exception) {.
proc raiseException(e: ref Exception, ename: cstring) {. proc raiseException(e: ref Exception, ename: cstring) {.
compilerproc, asmNoStackFrame.} = compilerproc, asmNoStackFrame.} =
e.name = ename e.name = ename
when not defined(noUnhandledHandler):
if excHandler == 0: if excHandler == 0:
unhandledException(e) unhandledException(e)
asm "throw `e`;" asm "throw `e`;"
@ -122,6 +123,7 @@ proc reraiseException() {.compilerproc, asmNoStackFrame.} =
if lastJSError == nil: if lastJSError == nil:
raise newException(ReraiseError, "no exception to reraise") raise newException(ReraiseError, "no exception to reraise")
else: else:
when not defined(noUnhandledHandler):
if excHandler == 0: if excHandler == 0:
var isNimException : bool var isNimException : bool
asm "`isNimException` = lastJSError.m_type;" asm "`isNimException` = lastJSError.m_type;"