Simn / genjvm

13 stars 1 forks source link

Reflect.hx #23

Closed Simn closed 5 years ago

Simn commented 5 years ago

Regarding isObject: The problem with this is that we always box primitive values when assigning to Dynamic, as is the case here. This means that isObject(12) and isObject((12 : Null<Int>)) are indistinguishable within the function body.

The genjava implementation solves this by doing a whole bunch of Std.is checks against java.lang.Number, java.lang.Boolean etc. The question here is if we're talking about "object" in the run-time sense or the Haxe-sense.

Simn commented 5 years ago

deleteField requires hijacking any field write operation on the object. That's the only way we can re-install a previously deleted field. What a pain...

Simn commented 5 years ago

All done!