[Helma-user] HopObject-Constructor: calling Prototypename() instead of constructor()?

Anton Pirker helma at gmiatlich.net
Tue Sep 25 18:37:08 CEST 2007


Hi list!

Deep down in my memories i darkly remember that there was a discussion 
whether call the constructor of a prototype constructor() or like the 
prototype name. For example: Venue().

What is the preferred way in Helma as of now? I would love to use a 
constructor named like the Prototype (as it is in many other programming 
languages)

I tried it and found that both ways are possible in Helma. But i also 
discovered that if the constructor is called Venue(), i cannot use 
static methods of the Prototype defined like this: Venue.doCreate = 
function(name) {..} anymore.

I have made a little demo-app to show this behaviour. If you start the 
application you will get an error. If you rename Venue() in 
Venue/objectFunctions.js to construtor() and restart Helma (this is 
necessary) everything works fine.

Is this intended, or is it a bug?


Have a nice evening,
Anton

-------------- next part --------------
A non-text attachment was scrubbed...
Name: demo.zip
Type: application/octet-stream
Size: 1249 bytes
Desc: not available
Url : http://helma.org/pipermail/helma-user/attachments/20070925/38e2e2ca/attachment.obj 


More information about the Helma-user mailing list