Map/Set.prototype.size

David Bruant bruant.d at gmail.com
Fri Oct 12 08:16:19 PDT 2012


Hi,

Firefox has implement a Map/Set.prototype.size *method* to query the number
of mapping/elements.
It's not in the strawman. It appears in the latest draft, though weirdly
enough Map.prototype.size is a function with an unused argument.
What about making it an getter instead of a function? I guess we also don't
need the extra parens to request for Map#keys, Map#values, Map#items.

Unlike Java, JavaScript is lucky enough to have getter/setters, we should
use them, even in the spec. The boat for myArray.length has sunk a while
ago, but new constructs can get this right.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121012/c4aa6f96/attachment.html>


More information about the es-discuss mailing list