Try/Catch support for native JS exceptions (#8955)

* Try/Catch support for native JS exceptions

* Better tests
This commit is contained in:
LemonBoy 2018-10-09 19:51:29 +02:00 • committed by Andreas Rumpf
commit a3fb0a769c
4 changed files with 77 additions and 8 deletions

View file

@ -1739,13 +1739,14 @@ proc isException*(t: PType): bool =
return false
proc isImportedException*(t: PType; conf: ConfigRef): bool =
assert(t != nil)
assert t != nil
if optNoCppExceptions in conf.globalOptions:
return false
let base = t.skipTypes({tyAlias, tyPtr, tyDistinct, tyGenericInst})
if base.sym != nil and sfCompileToCpp in base.sym.flags:
if base.sym != nil and {sfCompileToCpp, sfImportc} * base.sym.flags != {}:
result = true
proc isInfixAs*(n: PNode): bool =