HopObject-Constructor: calling Prototypename() instead of constructor()?
Anton Pirker <[email protected]> Tue, 25 Sep 2007 18:37:08 +0200
| Newsgroups | gmane.comp.java.helma.general |
|---|---|
| Message-ID | <[email protected]> |
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
_______________________________________________
Helma-user mailing list
[email protected]
http://helma.org/mailman/listinfo/helma-user
demo.zip
(application/octet-stream, 1.2 KB) - not displayed