It all started with me having to add the “default” property on an object. Of course, default is a keyword in Haxe, so I had to do var myObject: Dynamic = {"default": myProperty}
.
All fine and dandy, but then, at a later time in my application, I also want to add a.dot.notation.property
to that same myObject
. Of course, the object initializer is no longer an option at that point. So, I used Reflect.setField
, but we all know what the costs of Reflect are. Fortunately, this is a one-time operation at applications startup so no biggie for me.
Just wandering if there’s some other obvious way that I missed. I’ve looked at DynamicAccess but that’s a wrapper over Reflect too.