Added noUnhandledHandler
This commit is contained in:
parent
fa1f3aecce
commit
ffa4f8dc99
1 changed files with 9 additions and 7 deletions
|
|
@ -114,19 +114,21 @@ 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
|
||||||
if excHandler == 0:
|
when not defined(noUnhandledHandler):
|
||||||
unhandledException(e)
|
if excHandler == 0:
|
||||||
|
unhandledException(e)
|
||||||
asm "throw `e`;"
|
asm "throw `e`;"
|
||||||
|
|
||||||
proc reraiseException() {.compilerproc, asmNoStackFrame.} =
|
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:
|
||||||
if excHandler == 0:
|
when not defined(noUnhandledHandler):
|
||||||
var isNimException : bool
|
if excHandler == 0:
|
||||||
asm "`isNimException` = lastJSError.m_type;"
|
var isNimException : bool
|
||||||
if isNimException:
|
asm "`isNimException` = lastJSError.m_type;"
|
||||||
unhandledException(cast[ref Exception](lastJSError))
|
if isNimException:
|
||||||
|
unhandledException(cast[ref Exception](lastJSError))
|
||||||
asm "throw lastJSError;"
|
asm "throw lastJSError;"
|
||||||
|
|
||||||
proc raiseOverflow {.exportc: "raiseOverflow", noreturn.} =
|
proc raiseOverflow {.exportc: "raiseOverflow", noreturn.} =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue