hscript icon indicating copy to clipboard operation
hscript copied to clipboard

Haxe4 try-catch

Open Kriptel opened this issue 9 months ago • 3 comments

I think it would be a good idea to add some changes to try-catch from Haxe 4 versions, such as wildcard catch and multiple catch

(multiple catch)

try {}
catch (v:A) {}
catch (v:B) {}
catch(e:haxe.Exception) {}

Kriptel avatar Jun 02 '25 14:06 Kriptel

Will it be dangerous to change ETry for such changes?

from:

ETry( e : Expr, v : String, t : Null<CType>, ecatch : Expr );

to:

ETry( e : Expr, catchList:Array<{ v : String, t : Null<CType>, ecatch : Expr }> );

Kriptel avatar Jun 02 '25 14:06 Kriptel

The only possible problem in the hscript.Bytes encoding that should be adapted to support for older try-catches binaries, so that both old and new data are supported.

ncannasse avatar Jun 07 '25 08:06 ncannasse

Along with #145, I would give a different index to the new try catch

Kriptel avatar Jun 07 '25 08:06 Kriptel