[Laszlo-dev] Any portable way to write this idiom?

Henry Minsky hminsky at laszlosystems.com
Wed Sep 10 19:48:43 PDT 2008


In the debugger/LzMessage class, there is some code like this

  function toArray () {
    var array = [this.locationString(this.constructor.type)];

Which essentially gets the classname, via the static var "type", of
 whatever subclass of LzMessage is
being operated on. I guess I can write this['constructor'].type, but I
wonder if there is a better way
to be doing this? This seems a little bit baroque.

Maybe we should be overriding a "classname()" method on each of the
subclasses of LzMessage? Seems
like that would be more readable. Just trying to keep things easy to
understand/maintain....







-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080910/5340ce41/attachment.html


More information about the Laszlo-dev mailing list