Subj : Re: setter functions To : netscape.public.mozilla.jseng From : Brendan Eich Date : Mon Mar 17 2003 07:39 pm Phil Schwartau wrote: > Hi Georg, > > Thanks - I have filed a bug on this and cc'ed you on it: > http://bugzilla.mozilla.org/show_bug.cgi?id=197922 I resolved this bug WONTFIX. See http://bugzilla.mozilla.org/show_bug.cgi?id=197922#c1, which cites the thread at news://news.mozilla.org:119/39F81213.6DF2B209@skyrix.com in this group, which led to http://bugzilla.mozilla.org/show_bug.cgi?id=61482 being filed and fixed. /be > > > Phil > > Georg Maaß wrote: > >> This sample code no longer works. I alerts 3 times "undefined". In >> former times it alerted first "undefined", then "4711", then "Blarg!". >> >> Is this a bug or has the implementation of setter functions changed? >> The return value of the setter function seems to be useless. In >> former times it was used to initialize the property similiar to the >> implementation of watch handlers. >> >> >> o = {}; >> o.__defineSetter__('smell',function(v){return v==4711?v:'Blarg!';}); >> alert(o.smell); // undefined >> o.smell = 4711; alert(o.smell); // 4711 >> o.smell = 'davidoof'; alert(o.smell); // Blarg! >> >> >> >> Greetings, Georg > > .