Proxys are apparently exactly what I want. But they're not available on browsers atm... So I guess I'll just continue XJSAccessors and when Proxys get supported enough, I'll add a detection and use them if available.
On Fri, Sep 2, 2011 at 2:31 PM, Xavier MONTILLET <[email protected]> wrote: > I intend to support all browsers back to IE 6. > > On Fri, Sep 2, 2011 at 2:20 PM, Poetro <[email protected]> wrote: >> 2011/9/2 Xavier MONTILLET <[email protected]>: >>>> There are new language features creeping in that will allow us to do >>>> C#-style setters and getters, but I've almost never had a need for them in >>>> Javascript. >>> Well the first thing is native getters are way too slow: >>> http://jsperf.com/native-getters-vs-function-getters/3 >>> Plus they don't work in IE. >> >> Just for the book, there are the Object.defineProperty and >> Object.defineProperties methods, that are available in IE since IE9 >> and for DOM objects in IE8. >> >> https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperty >> https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/defineProperties >> >> -- >> Poetro >> >> -- >> To view archived discussions from the original JSMentors Mailman list: >> http://www.mail-archive.com/[email protected]/ >> >> To search via a non-Google archive, visit here: >> http://www.mail-archive.com/[email protected]/ >> >> To unsubscribe from this group, send email to >> [email protected] >> > -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
