On Sun, Apr 10, 2011 at 6:59 PM, Axel Rauschmayer <[email protected]> wrote:

> Exactly what I was looking for. Thanks.
>

Not exactly...



>
> On Apr 10, 2011, at 22:18 , David Herman wrote:
>
> > function getDefiningObject(obj, key) {
> >    if (!(key in obj))
> >        throw new Error("key " + key + " not found");
> >    while (!obj.hasOwnProperty(key))
>

That should be

         while (!{}.hasOwnProperty.call(obj, key))

which works even if obj has an own property named 'hasOwnProperty'.



> >        obj = Object.getPrototypeOf(obj);
> >    return obj;
> > }
> >
> > On Apr 10, 2011, at 10:24 AM, Axel Rauschmayer wrote:
> >
> >> As far as I am aware, there is no way to change a property that isn’t at
> the beginning of the property chain, because the change will create a new
> property there.
> >>
> >> Are there plans to change this? It would be nice to have something akin
> to class methods (without accessing the prototype via some other, e.g.
> global, reference).
> >>
> >> --
> >> Dr. Axel Rauschmayer
> >>
> >> [email protected]
> >> twitter.com/rauschma
> >>
> >> home: rauschma.de
> >> blog: 2ality.com
> >>
> >>
> >>
> >> _______________________________________________
> >> es-discuss mailing list
> >> [email protected]
> >> https://mail.mozilla.org/listinfo/es-discuss
> >
> >
>
> --
> Dr. Axel Rauschmayer
>
> [email protected]
> twitter.com/rauschma
>
> home: rauschma.de
> blog: 2ality.com
>
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
    Cheers,
    --MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to