It’s not. Dictionary supports indexed access. ObjectMap requires set and get.

Harbs

> On Feb 25, 2018, at 10:02 AM, Carlos Rovira <[email protected]> wrote:
> 
> Hi Harbs,
> 
> if ObjectMap is a Dictionary, why don't you rename it to that? I think it
> will make more easy for new comers to get it
> 
> Thanks
> 
> 2018-02-24 21:59 GMT+01:00 Gabe Harbs <[email protected] 
> <mailto:[email protected]>>:
> 
>> There is a ObjectMap class which uses WeakMap or Map and falls back to
>> regular objects on platforms whether that is not supported.
>> http://royale.apache.org/asdoc/#!org.apache.royale.utils/ObjectMap 
>> <http://royale.apache.org/asdoc/#!org.apache.royale.utils/ObjectMap> <
>> http://royale.apache.org/asdoc/#!org.apache.royale.utils/ObjectMap 
>> <http://royale.apache.org/asdoc/#!org.apache.royale.utils/ObjectMap>>
>> 
>> It should be a decent replacement for Dictionary (including weak
>> references). The only caveat is you need to use get() and set() instead of
>> bracket access.
>> 
>> I just added documentation and cleaned it up a bit.
>> 
>> What’s interesting about that class is I needed to do some weird things
>> with the methods to reassign them. They are not showing up in the ASDoc
>> very well…
>> 
>> There might be a better way to declare the method (variable) proxies. Not
>> sure…
>> 
>> HTH,
>> Harbs
>> 
>>> On Feb 24, 2018, at 9:10 PM, Greg Dove <[email protected]> wrote:
>>> 
>>> That might make porting some legacy Flex code a
>>> lot easier, for example because (iiuc) I think that means Dictionary with
>>> weak keys could be supported. [3] (and I know Harbs did something related
>>> to this in the past, maybe some sort of polyfill, can't recall exactly)
>> 
>> 
> 
> 
> -- 
> Carlos Rovira
> http://about.me/carlosrovira <http://about.me/carlosrovira>

Reply via email to