Try/Catch support for native JS exceptions (#8955)
* Try/Catch support for native JS exceptions * Better tests
This commit is contained in:
parent
f98a3056c6
commit
a3fb0a769c
4 changed files with 77 additions and 8 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue