[Laszlo-dev] fix for LPP-4289 "LzDataElementTrait#valueToElement(..)" must be a static-method

Henry Minsky henry.minsky at gmail.com
Fri Jul 20 10:11:14 PDT 2007


Actually try this one , it is against a more recent svn update

Change 20070720-hqm-8 by hqm at IBM-2E06404CB67 on 2007-07-20 13:05:54 EDT
    in /cygdrive/c/users/hqm/openlaszlo/legals4/WEB-INF/lps/lfc
    for http://svn.openlaszlo.org/openlaszlo/branches/legals/WEB-INF/lps/lfc

Summary:  fix for valueToElement

New Features:

Bugs Fixed: LPP-4289

Technical Reviewer: ptw (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:

make LzDataElement.valueToElement works as a static method


Tests:


try typing this to debugger
LzDataElement.valueToElement(259)

should get something like this

LzDataElement#3| <element>259</element>;


Files:
M      data/LzDataElement.lzs




On 7/20/07, Henry Minsky <henry.minsky at gmail.com> wrote:
>
> OK, here's the change for review then..
>
>
> Change 20070720-hqm-8 by hqm at IBM-2E06404CB67 on 2007-07-20 13:05:54 EDT
>     in /cygdrive/c/users/hqm/openlaszlo/legals4/WEB-INF/lps/lfc
>     for
> http://svn.openlaszlo.org/openlaszlo/branches/legals/WEB-INF/lps/lfc
>
> Summary:  fix for valueToElement
>
> New Features:
>
> Bugs Fixed: LPP-4289
>
> Technical Reviewer: ptw (pending)
> QA Reviewer: (pending)
> Doc Reviewer: (pending)
>
> Documentation:
>
> Release Notes:
>
> Details:
>
> make LzDataElement.valueToElement works as a static method
>
>
> Tests:
>
>
> try typing this to debugger
> LzDataElement.valueToElement (259)
>
> should get something like this
>
> LzDataElement#3| <element>259</element>;
>
>
> Files:
> M      data/LzDataElement.lzs
>
> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070720-hqm-8.tar
>
> On 7/20/07, P T Withington <ptw at openlaszlo.org > wrote:
> >
> > I think this is annoying but correct.
> >
> > The proposed (ECMAScript 4 Spec]( http://developer.mozilla.org/es4/
> > spec/chapter_9_classes.html) says:
> >
> > > Unlike in some other object oriented languages (e.g. Java), static
> > > properties of the base class are not inherited, but they are in
> > > scope in the static and instance methods of the derived class.
> > >
> > I don't know the rationale for that decision.  I think they adopted
> > it from [AS3]( http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/
> > common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000068.html).
> > On 2007-07-20, at 12:10 EDT, Henry Minsky wrote:
> >
> > > There's a bug filed (LPP-4289) about how
> > > lzDataElement.valueToElementdoesn't work in legals,
> > > because it needs to be a static method.
> > >
> > > The method is actually defined in the mixin lzDataElementTrait, and
> > > if I
> > > declare it static, it doesn't magically
> > > appear visible as LzDataElement.valueToElement. My solution so far
> > > looks
> > > like this, which declares it again
> > > in LzDataElement. Is there a better way to do this?
> > >
> > >
> > >
> > > trait LzDataElementTrait {
> > >
> > > static function valueToElement ( o ) {
> > >    var n = new LzDataElement("element", { },
> > > LzDataElementTrait.__LZv2E(o));
> > >    return n;
> > > }
> > >
> > > static function __LZv2E ( o ) { ... }
> > >
> > > }
> > >
> > >
> > > class LzDataElement extends LzMiniNode inherits LzDataElementTrait,
> > > LzDataNode {
> > > ...
> > > ...
> > > static var valueToElement = LzDataElementTrait.valueToElement ;
> > > }
> > >
> > > --
> > > Henry Minsky
> > > Software Architect
> > > hminsky at laszlosystems.com
> >
> >
>
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
>
>


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


More information about the Laszlo-dev mailing list