[Laszlo-dev] [Laszlo-checkins] r8118 - openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc

P T Withington ptw at pobox.com
Thu Feb 28 10:03:08 PST 2008


On 2008-02-27, at 17:08 EST, dda at openlaszlo.org wrote:

>    There is also a fix to the ParseTreePrinter so that it knows how  
> to print
>    'cast'.  This wasn't needed before to print final output from  
> JS1, since
>    casts were always removed.  Casts are generated in the dependency  
> source
>    so they will work with SWF9 - without it, the flex compile  
> complains
>    about references to nonexistant dependency functions.   
> Downcasting to
>    Object makes the compiler *less* strict and accepting of any  
> function name.
>    The output from the simple dependency given above has been tested  
> to
>    compile with flex2 as a proof of concept.

FWIW, The flex compiler has the same loophole that we have in our swf  
compiler to get around checking.  To call a dynamic function or access  
a dynamic value, instead of:

   foo.bar()

you write:

   foo['bar']()

In other words, using `[]` to access members instead of `.` turns off  
the compiler optimization (which results in the compiler complaint).

Eventually we will want to tweak the generator to not use the cast or  
`[]`, because these dependency functions _should_ all be known at  
compile time.


More information about the Laszlo-dev mailing list