haxe
haxe copied to clipboard
[PHP] haxe.Exception native check
Hej,
Sorry for annoying you with these exceptions but this piece of code works everywhere but in PHP it gives something wrong :
class Err extends haxe.Exception{
public function new( o : Any ){
trace( o );
super( null, null, o );
trace( this.native );
}
}
class Test {
static function main() {
var err = new Err( true );
}
}
I get true and true on JS, Neko, Eval, HL but in PHP it gives that :
src/com/Main.hx:19: true
src/com/Main.hx:21: com\Err in /media/filt3rek/common/home/filt3rek/work/_tests/test/export/php/lib/com/Main.php:16
Stack trace:
#0 /media/filt3rek/common/home/filt3rek/work/_tests/test/export/php/index.php(14): com\Main::main()
#1 {main}
I think it's comming form here : https://github.com/HaxeFoundation/haxe/blob/4.3.5/std/php/_std/haxe/Exception.hx#L47
If native can be anything, this && Std.isOfType(native, Throwable is wrong ... if I remove that check, it works fine.
Thanks for your help,