Hi! First of all, I'd like to congratulate you for the development of jsolait.
Recently, I began testing the inheritance (according to the tutorial) an was getting error messages.
Today, I decided to test again using the first release (1.0) version and everything went well...
The code I used to test (basically a copy of a sample taken from the yahoo groups):
SomeClass = Class(function(publ, supr){
var private_static_obj = "Hello World";
publ.init = function(abcd){
this.prop1 = abcd;
}
publ.someMethod = function(){
print(private_static_obj);
print(this.prop1);
}
})
SubClass = Class(SomeClass, function(publ, supr){
var a_module_private_obj = "myPrivateData";
publ.init = function(){
supr(this).init("easy to call super's methods");
}
publ.someMethod = function(){
supr(this).someMethod();
print(a_module_private_obj);
}
})
var obj1 = new SomeClass("foo");
var obj2 = new SubClass("bar");
obj1.someMethod();
obj2.someMethod();
Expected result (obtained with 1.0 release):
Hello World
foo
Hello World
easy to call super's methods
myPrivateData
Erroneous result (obtained with both 2.0a small development trunk and subversion):
Hello World
undefined
And Javascript console fired:
Error: supr is not a function
Hope this can help! If this is a syntax mistake from me, please document 2.0 version's inheritance (tutorial?).
Thank you in advance for the time spent analysing this!
Helder