Hi Radoslav, > There must be a smarter way with this, but I'm still a git newbie.
Hey, you're better at it than I am. :-) > Bw, this worked fine, since $super is attached to function It only worked because you only had a Parent < Child hierarchy. As soon as you throw a third level into it (the "grandchild test"), e.g. Parent < Child < GrandChild, if any of the middle layers (Child, in this case) tries to do a supercall, it will *endlessly recurse*. Really. Again, please read my reply to Allen above[1] for details. [1] http://groups.google.com/group/prototype-core/browse_thread/thread/db9ccdaae4f7f705/c84a73f979fafc2c?#c84a73f979fafc2c -- T.J. On Sep 8, 1:03 pm, Radoslav Stankov <rstan...@gmail.com> wrote: > "git pull origin supercalls" is needed for getting not only the master > branch. So we have: > > git clone git://github.com/tjcrowder/prototype.git > cd prototype > git branch supercalls > git checkout supercalls > git pull origin supercalls > rake dist > > There must be a smarter way with this, but I'm still a git newbie. > > Bw, this worked fine, since $super is attached to function > > <pre> > var SuperKlass = Class.create({ > update: function(){ console.log('super'); } > > }); > > // written also as > var SuperKlass = Class.create((function(){ > function update(){ console.log('super'); } > return {update: update}; > > })()); > > var SubKlass = Class.create(SuperKlass, { > update: function(){ > this.update.$super.call(this); > console.log('sub'); > } > > }); > > (new SubKlass()).update() > </pre> > > p.s. on my MacOX Leopard, it behaves very good > > Safari4: > test loops: 100000 > Old mechanism time: 686ms > New mechanism time: 123ms > > Firefox 3.5 > test loops: 100000 > Old mechanism time: 14868ms > New mechanism time: 442ms --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~----------~----~----~----~------~----~------~--~---