kazu2012 / persevere-framework

Automatically exported from code.google.com/p/persevere-framework
0 stars 0 forks source link

Static methods not inherited #260

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Steps to reproduce:

1) Download persevere1.0.zip, unzip
2) Create /WEB-INF/jslib/SuperClass.js containing:

Class({
   id:"SuperClass", 
   foo:function(){ 
      return "hello"; 
   }
});

3) Create /WEB-INF/jslib/SubClass.js containing:

require("SuperClass.js");
Class({
    id:"SubClass", 
    "extends":SuperClass
});

4) Run java -jar start.jar
5) At the js> prompt, enter: SuperClass.foo(); 
6) At the js> prompt, enter: SubClass.foo();

Output for step 5:

js>SuperClass.foo();
hello

Output for step 6:

js>SubClass.foo();
TypeError: Cannot find function foo in object [object Class].

I expected step 6 to return "hello" based on the info here: 

http://groups.google.com/group/persevere-
framework/browse_thread/thread/8d8c2f93f6ca52fe/a4745988e0424a2f?
lnk=gst&q=updates#a4745988e0424a2f

Original issue reported on code.google.com by twin...@gmail.com on 8 Jan 2010 at 8:49

GoogleCodeExporter commented 8 years ago
The above link is broken. Here's the info from the link:
...
* Classes themselves now inherit from their super classes. Before, only 
the class prototype has inherited, but now static methods and properties 
(those that are directly on the class) are inherited as well. 
Class({id:"SuperClass", foo:function(){..}}); 
Class({id:"SubClass", "extends":SuperClass}); 
SubClass.foo();
...

Original comment by twin...@gmail.com on 8 Jan 2010 at 10:10