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]

Reply via email to