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

Donald Anderson dda at ddanderson.com
Fri Feb 29 07:38:29 PST 2008


On Feb 28, 2008, at 1:03 PM, P T Withington wrote:

> 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).

I wonder if [] is the same, performance wise as doing cast to Object.
It might be relevant - see below.

> 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.


I think there are things outside our tree that can be called.  For  
example, can't a function call into
the flex2 library - and we don't want to do call  
flex2.SomeClass.foo_dependencies .
Or is that not allowed in these sorts of functions?

- Don


--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-547-7881
email: dda at ddanderson.com
www: http://www.ddanderson.com






More information about the Laszlo-dev mailing list