On Wed, Nov 4, 2015 at 4:56 AM, Romuald Quantin <r...@soundstep.com> wrote:

> As an aside and as Coroutines,
>
> I never understood why there is this inability to enumerate WeakMap keys.
>

If I had it my way there would be no WeakMap or WeakSet.  I'd have a
Symbol.mode similar to Lua's __mode meta(method/field?) that would show the
garbage collector that keys or values are weakly referenced in an object.
Or even:

obj[Symbol.weakValues] = true;
obj[Symbol.weakProperties] = true;

WeakMap isn't really all that special.  Set is important for how it
maintains only unique values are inserted - but you could do this with
Proxy.  I think I come across as a Lua fanboy... I enjoyed the minimalism
of Lua for sure :-)

I wish I could have weak references in arrays... :3  Iterate to .length,
skipping undefined/null values (where things have been collected).
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to