Hi, I'm trying to mix native JS getters and setters with Class.create, with little success so far. Here's what I tried:
=====8<===== var MyClass = {}; MyClass.__defineGetter__('test', function() { alert('inside getter'); return 'foo'; }); MyClass.__defineSetter__('test', function(new_value) { alert('inside setter'); return new_value; }); MyClass = Class.create(MyClass); var foo = new MyClass(); foo.test; // should alert 'inside getter' foo.test = 'bar'; // should alert 'inside setter' =====>8===== Evaluating this code with prototype 1.6.0.2 I only get the 'inside getter' message alerted, but not the setter one, so getters resist Class.create but not setters. Is there something wrong I'm doing or are setters just not supported in prototype? I'll note that I'm working against Safari on iPhone only so I'm not worried about compatibility issues while using JS getters and setters. Thanks for your help, Antoine --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---