Closed RblSb closed 5 years ago
Oh, i found #18 now. And actual issue is HaxeFoundation/haxe/issues/5946. Maybe leave this issue open until fix?
Closing, the JS issue will be fixed for Haxe 4.0
@ncannasse I guess after https://github.com/HaxeFoundation/haxe/pull/7658 merge these lines should use cast
instead of Std.instance
for haxe 4?
Right, we should use a Std.is + unsafe cast, as Std.instance on interfaces are not guaranteed.
In latest Haxe 4 , Std.instance (now Std.downcast) is well specified and tested for interfaces as well.
https://github.com/ncannasse/hxbit/blob/master/hxbit/NetworkHost.hx#L584 When o is Cursor instance, n is null on js target (Heaps Network sample). After replacing it with safe cast, the code worked with my WebSocketHost. I think this should be replaced with safe/unsafe cast in try/catch at least for JS? The docs says "This method is not guaranteed to work with interfaces". Another using of Std.instance here.