A different semantics for WeakMap#get default value

Andreas Rossberg rossberg at google.com
Thu Jan 19 05:36:40 PST 2012


On 19 January 2012 09:00, Andrea Giammarchi <andrea.giammarchi at gmail.com> wrote:
> Out of curiosity, Chrome experimental flag does not support get(key,
> defaultValue) but get(key) only ... is this something missing or Map and
> WeakMap will never support officially the second get() argument?

Chrome/V8 simply implements what the current proposals say:

http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets
http://wiki.ecmascript.org/doku.php?id=harmony:weak_maps

Of course, we are happy to adapt if the proposals get extended along
the lines you mention.

/Andreas


More information about the es-discuss mailing list