Added noUnhandledHandler
This commit is contained in:
parent
fa1f3aecce
commit
ffa4f8dc99
1 changed files with 9 additions and 7 deletions
|
|
@ -114,6 +114,7 @@ proc unhandledException(e: ref Exception) {.
|
|||
proc raiseException(e: ref Exception, ename: cstring) {.
|
||||
compilerproc, asmNoStackFrame.} =
|
||||
e.name = ename
|
||||
when not defined(noUnhandledHandler):
|
||||
if excHandler == 0:
|
||||
unhandledException(e)
|
||||
asm "throw `e`;"
|
||||
|
|
@ -122,6 +123,7 @@ proc reraiseException() {.compilerproc, asmNoStackFrame.} =
|
|||
if lastJSError == nil:
|
||||
raise newException(ReraiseError, "no exception to reraise")
|
||||
else:
|
||||
when not defined(noUnhandledHandler):
|
||||
if excHandler == 0:
|
||||
var isNimException : bool
|
||||
asm "`isNimException` = lastJSError.m_type;"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue