WeakMap better than Private Symbols? (was: direct_proxies "problem")

Erik Arvidsson erik.arvidsson at gmail.com
Thu Jan 10 08:57:59 PST 2013


On Thu, Jan 10, 2013 at 11:55 AM, Kevin Smith <khs4473 at gmail.com> wrote:

>
> They both have their place since there's many uses for both inherited and
>> non-inherited private values.
>>
>
> Can we see some demonstrated use-cases for which WeakMaps are
> insufficient, and private properties are?  I continue to hear that private
> symbols are a great idea without any discussion of the tradeoff:  a more
> complicated (and more difficult to reason about) runtime object model.
>

Inheritance is one use case. Assume you want a "virtual" "protected"
method. With private symbols you set it on the prototypes. For WM you would
have to set up the map for every instance and find a strategy for storing
the correct function.

-- 
erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130110/cb293faf/attachment-0001.html>


More information about the es-discuss mailing list