genTryCpp to catch by Nim type, ready for first review (#7196)

* Rewrite genTryCpp

* correction

* Implement polymorphic raise in cpp

* revert backticks in emit

* Cleanp a comment

* revert test changes

* better handling of <new> header
This commit is contained in:
cooldome
2018-02-12 20:23:34 +00:00
committed by Andreas Rumpf
parent 7cbab49645
commit d24b6667c6
10 changed files with 110 additions and 79 deletions

View File

@@ -320,7 +320,7 @@ proc raiseExceptionAux(e: ref Exception) =
quitOrDebug()
else:
pushCurrentException(e)
{.emit: "throw NimException(`e`, `e`->name);".}
{.emit: "`e`->raise();".}
else:
if excHandler != nil:
if not excHandler.hasRaiseAction or excHandler.raiseAction(e):