Adding := for a rare and usually wrong operation is not going to happen. Let's please focus on real problems, especially when proposing new syntax.
/be On Jun 23, 2011, at 4:56 AM, Axel Rauschmayer wrote: > There are indeed a few ways around this: > Naming the prototype, using an array with a single element, etc. > > On Jun 23, 2011, at 13:19 , David Bruant wrote: > >> Hi, >> >> In a the provided example, you assign a value. Can't you just use a >> getter/setter pair on the prototype chain? It sounds like it would solve >> your use case (without the syntax sugar). On ES5 - 8.12.5 step 4 & 5, the >> prototype chain is climbed to look up for an accessor and if there is a >> setter (anywhere on the prototype chain), this setter is called. Combined >> with the fact that a getter naturally do the same thing for getters, you >> have your way to change a value "directly on the prototype chain". >> Of course, if you want to change the property descriptor on the prototype >> chain, none of what I said apply. >> >> David >> >> >> Le 21/06/2011 17:24, Axel Rauschmayer a écrit : >>> As a loose analog to the prototype-chain-traversing >>> getPropertyDescriptor(), I would still like to have something that allows >>> one to easily *change* properties higher up the prototype chain (e.g. to >>> use a prototype to share state). >>> >>> Maybe it would be enough to just have Object.getDefiningObject(obj, >>> propName): >>> http://www.mail-archive.com/es-discuss@mozilla.org/msg06652.html >>> >>> But I can also imagine syntactic sugar: >>> obj.foo := "abc" >>> desugars to >>> Object.getDefiningObject(obj, "foo").foo = "abc" >> > > -- > Dr. Axel Rauschmayer > > a...@rauschma.de > twitter.com/rauschma > > home: rauschma.de > blog: 2ality.com > > > > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss