Classes: Enumerability of methods and constructor

John J Barton johnjbarton at johnjbarton.com
Mon Mar 26 20:47:50 PDT 2012


On Mon, Mar 26, 2012 at 8:22 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>wrote:

> not enumerable, all around. In the proposal it say class def method will
> follow the same attribute conventions as obj lit concise methods.
>

I appreciate understanding why this choice.

(FWIW, I totally don't get why non-enumerable even exists).

jjb


>
>
> Erik Arvidsson <erik.arvidsson at gmail.com> wrote:
>
> >1. Are methods supposed to be enumerable?
> >
> >The native classes (Date etc) don't have enumerable methods and the
> >new method property shorthand for object literals is not enumerable
> >either.
> >
> >2. Should constructor be enumerable?
> >
> >function C() {}
> >var c = new C;
> >c.__proto__.propertyIsEnumerable('constructor')  // false
> >
> >--
> >erik
> >_______________________________________________
> >es-discuss mailing list
> >es-discuss at mozilla.org
> >https://mail.mozilla.org/listinfo/es-discuss
> >
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120326/006cb989/attachment.html>


More information about the es-discuss mailing list