Closed Kambfhase closed 13 years ago
Within the closure loop you need to maintain a reference to any old vaue of the .supr property. See John Resigs simple inheritance.
Test case:
var A = klass({ first: function(){ return "first"; }, second: function(){ return "second"; } }), B=A.extend(function(){}).methods({ first: function(){ this.second(); return this.supr(); }, second: function(){ return this.supr(); } }); console.log( new A().second()); // "second" console.log( new A().first()); // "first" console.log( new B().second()); // "second" console.log( new B().first()); // "second", should be "first"
mfg Kambfhase
you're right. we'll have a play on getting that working
oh doi, nevermind
fixed! thanks for pointing that out!
Within the closure loop you need to maintain a reference to any old vaue of the .supr property. See John Resigs simple inheritance.
Test case:
mfg Kambfhase