ECMA TC 39 / W3C HTML and WebApps WG coordination

Mark S. Miller erights at google.com
Fri Sep 25 20:48:07 PDT 2009


On Fri, Sep 25, 2009 at 8:27 PM, Mark S. Miller <erights at google.com> wrote:
> OTOH, if our resolution of the need for array-like generic indexes is
> to allow overloading of [], then perhaps the resolution for new APIs
> is to annotate them somehow, to distinguish them from the
> legacy-namespace-confused-APIs-we-can't-fix, so that, for example,
>
>    storage['toString'] is equivalent to storage.getItem('toString'),
> and neither is considered a property access (other than access to the
> getItem property).
>    storage.toString accesses storage's toString property, and is not
> affected by the alternate getter annotation we'd use instead of the
> above.

I withdraw that alternate suggestion. It would require any code
attempting to access genuine properties of the storage object by
computed name to resort to indirect and inconvenience means, like
using Object.getOwnPropertyDescriptor() and simulating the [[Get]]
algorithm.


-- 
    Cheers,
    --MarkM


More information about the es-discuss mailing list