Array.prototype.contains

Brendan Eich brendan at mozilla.org
Sat Nov 3 18:42:37 PDT 2012


Mark S. Miller wrote:
> WeakMap.has is fine (and already speced) because the presence of the 
> association depends on the key. However, if the key is garbage, a 
> strong ref to the value does not preserve the association in the map.

Right! Thanks.

/be
>
>
> On Sat, Nov 3, 2012 at 6:05 PM, Brendan Eich <brendan at mozilla.org 
> <mailto:brendan at mozilla.org>> wrote:
>
>     Is this true? I can see how enumeration and size would leak the GC
>     schedule, but to test has or contains, you need a strong ref,
>     which means the key or value cannot yet be garbage. If you have
>     the capability, there's no non-determinism. What am I missing?
>
>     /be
>
>     Allen Wirfs-Brock wrote:
>
>
>         On Nov 3, 2012, at 4:53 PM, Mark S. Miller wrote:
>
>             On Fri, Nov 2, 2012 at 5:26 PM, Allen Wirfs-Brock
>             <allen at wirfs-brock.com <mailto:allen at wirfs-brock.com>
>             <mailto:allen at wirfs-brock.com
>             <mailto:allen at wirfs-brock.com>>> wrote:
>
>
>                 Also any reason contains should be provided for
>             WeakMap? I not
>                 seeing why it shouldn't be there too.
>
>
>             Yes!
>
>             The set of values actually contained by the WeakMap at any
>             moment is non-deterministic, depending on the scheduling
>             of gc. But this non-determinism is non-observable.
>             WeakMap.contains would make it observable.
>
>
>
>         yup
>
>
>
>
>             -- 
>                 Cheers,
>                 --MarkM
>
>
>         _______________________________________________
>         es-discuss mailing list
>         es-discuss at mozilla.org <mailto:es-discuss at mozilla.org>
>         https://mail.mozilla.org/listinfo/es-discuss
>
>
>
>
> -- 
>     Cheers,
>     --MarkM
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list