[Laszlo-dev] For Review: Change 20070213-maxcarlson-a Summary: Add support for mixins in user classes

Philip Romanik promanik at laszlosystems.com
Tue Feb 13 14:26:48 PST 2007


Hi Max,

There's a problem when you try to mixin an invalid class name. In swf/debug 
it locks up the app. In dhtml it generates an error inside Class.lzx 
because t does not have the property makeInterstitial.

Class.lzx:
     if (traitsAndSuperclass instanceof Array) {
       while (traitsAndSuperclass.length) {
         var t = traitsAndSuperclass.pop();
         prototype = t.makeInterstitial(prototype, 
traitsAndSuperclass.length > 0);
       }
     }

Can't you generate an error if the class name is invalid? Here's a test case.

<canvas>
     <class name="bogus" with="LzBogus"/>
     <bogus/>
</canvas>


Phil


>Change 20070213-maxcarlson-a by maxcarlson at max-carlsons-
>computer.local on 2007-02-13 12:49:42 PST
>      in /Users/maxcarlson/openlaszlo/legals
>
>Summary: Add support for mixins in user classes
>
>New Features:
>
>Bugs Fixed: LPP-3547 - Add mixin 'with' attribute support to <class/>
>tag
>
>Technical Reviewer: ptw
>QA Reviewer: promanik
>Doc Reviewer: (pending)
>
>Documentation:
>
>Release Notes:
>
>Details: lzx.rnc - change 'traits' to 'with'
>
>UserClass.lzs - Process 'with' attribute into traitList if specified
>by compiler
>
>ClassCompiler.java - Update comment to show new syntax and output.
>
>Tests: This adds just enough support to allow the 'with' attribute in
>a user class to specify a list of mixins:
>
><canvas>
>      <class name="foobar" extends="drawview"
>with="LzDataElementTrait, LzDataNode"/>
>      <class name="bz" with="LzDataNode"/>
>
>      <foobar/>
>      <bz/>
></canvas>
>
>Files:
>M      WEB-INF/lps/schema/lzx.rnc
>M      WEB-INF/lps/lfc/core/UserClass.lzs
>M      WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java
>
>Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070213-
>maxcarlson-a.tar



More information about the Laszlo-dev mailing list