Subj : Re: setter functions To : netscape.public.mozilla.jseng From : Phil Schwartau Date : Mon Mar 17 2003 05:02 pm 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 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 .