JavaScript terminology: non-function-valued property

Rick Waldron waldron.rick at gmail.com
Fri Jul 22 16:08:53 PDT 2011


I'd like to speak on behalf of the JavaScript Community that you mentioned
above... Unequivocally, a property is a property and method is a property
whose value is a function.

Simply, "property" and "method". This terminology is used widely in
publication and conversation.


Rick



On Fri, Jul 22, 2011 at 6:37 PM, Axel Rauschmayer <axel at rauschma.de> wrote:

> Possible. I assumed, because String.prototype.length does not seem to be
> generic (in the sense that, say, String.prototype.trim() is).
>
>  Object.getOwnPropertyDescriptor(String.prototype, "length")
> { value: 0,
>   writable: false,
>   enumerable: false,
>   configurable: false }
>
> In contrast, trim() is clearly borrowed from the wrapper’s prototype:
>
>     > "".trim === String.prototype.trim
>     true
>
> ES-262, Sect. 8.4 only says: “The String type is the set of all finite
> ordered sequences of zero or more 16-bit unsigned integer values” (etc.). It
> does not mention how indexed access or length is handled.
>
>
> On Jul 23, 2011, at 0:16 , Mike Shaver wrote:
>
> Which primitives have own properties?  I thought even "str".length
> conceptually came from the prototype.
>
> Mike
>  On Jul 22, 2011 6:13 PM, "Axel Rauschmayer" <axel at rauschma.de> wrote:
> > To contrast non-method properties with methods:
> > - To say that instances usually only have non-method properties.
> > - To say that primitives can have non-method properties, but don’t have
> their own methods (they borrow them from their wrapper types).
> >
> > Maybe “non-method property” is good enough for that purpose.
> >
> > On Jul 23, 2011, at 0:00 , Brendan Eich wrote:
> >
> >> On Jul 22, 2011, at 2:55 PM, Axel Rauschmayer wrote:
> >>
> >>> I’m still wondering if there is an established term for a
> non-function-valued property in the JavaScript community (where method is a
> term for a function-valued property). Possibilities that I see are:
> >>
> >> Why do you need this term? In what practical sentence would you use it?
> >>
> >> /be
> >>
> >>
> >>>
> >>> - instance variable
> >>> - member variable
> >>> - field
> >>>
> >>> OO literature sometimes uses the term “attribute” but that is already
> taken by ES-262.
> >>>
> >>> --
> >>> Dr. Axel Rauschmayer
> >>>
> >>> axel at rauschma.de
> >>> twitter.com/rauschma
> >>>
> >>> home: rauschma.de
> >>> blog: 2ality.com
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> es-discuss mailing list
> >>> es-discuss at mozilla.org
> >>> https://mail.mozilla.org/listinfo/es-discuss
> >>
> >>
> >
> > --
> > Dr. Axel Rauschmayer
> >
> > axel at rauschma.de
> > twitter.com/rauschma
> >
> > home: rauschma.de
> > blog: 2ality.com
> >
> >
> >
> > _______________________________________________
> > es-discuss mailing list
> > es-discuss at mozilla.org
> > https://mail.mozilla.org/listinfo/es-discuss
>
>
>       --
> Dr. Axel Rauschmayer
>
> axel at rauschma.de
> twitter.com/rauschma
>
> home: rauschma.de
> blog: 2ality.com
>
>
>
>
> _______________________________________________
> 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/20110722/9a77d141/attachment.html>


More information about the es-discuss mailing list