[Proto-Scripty] I need to initialize base class an do not bothe user to call $super in subclass

2012-01-03 Thread buda
How to setup base class so that subclasses don't neet to call $super in their initialize method (because they might skip this call or call with wrong parameters) ? -- You received this message because you are subscribed to the Google Groups Prototype script.aculo.us group. To post to this

Re: [Proto-Scripty] I need to initialize base class an do not bothe user to call $super in subclass

2012-01-03 Thread Johan Arensman
Have you ever considered not including the initialize method in the subclass? Perhaps your baseclass can check if there's a child 'constructor' present and automatically call that: var MySuper = Class.create({ initialize: function() { // do stuff if (this.childConstructor) {

[Proto-Scripty] Re: I need to initialize base class an do not bothe user to call $super in subclass

2012-01-03 Thread buda
Thanks, it's usefull ! On 3 янв, 16:34, Johan Arensman johanm...@gmail.com wrote: Have you ever considered not including the initialize method in the subclass? Perhaps your baseclass can check if there's a child 'constructor' present and automatically call that: var MySuper =