[Laszlo-dev] For Review: Change 20080502-ptw-H Summary: Make handler trampoline work in swf9

P T Withington ptw at pobox.com
Mon May 5 15:23:26 PDT 2008


Ok, my simple attempt to do this really makes matters much worse,  
because now every LFC method _other_than_ toString cannot be  
overridden (at least until we address http://jira.openlaszlo.org/jira/browse/LPP-5934 
: 'declare public LFC methods and attributes as public').

Still want to go forward with this plan?

On 2008-05-05, at 00:19 EDT, Henry Minsky wrote:

> I think it would be fine to make all  used-defined LZX methods be  
> public. I
> don't think we need to
> make any of the 'internal' gensym'ed anonymous handler methods  
> public or
> anything.
>
>
>
> On Sun, May 4, 2008 at 1:52 PM, P T Withington <ptw at pobox.com> wrote:
>
>> Should we just make all LZX methods public?
>>
>> I don't think we want to burden the LZX programmer with this issue.
>>
>> The other alternative is to shove toString into the prototype.   
>> What AS3
>> does, for back-compatibility is put toString on Object.prototype.   
>> You can
>> override that in your class by defining your own toString on your  
>> class
>> prototype, but then you can't make super calls.  If a class has a  
>> public
>> toString method, AS3 will call that in preference to the  
>> Object.prototype
>> function.  But it has to be public.  If you don't declare it  
>> public, you can
>> call it directly in your code but `String(foo)` and `'' + foo` will  
>> not.
>>
>>
>> On 2008-05-03, at 21:18 EDT, Henry Minsky wrote:
>>
>> lzpix is getting a similar issue when I try to compile it in swf9
>>>
>>> org.openlaszlo.sc.CompilerError: line 107: Error: Incompatible  
>>> override,
>>> in
>>> line: override function toString () {
>>> line 243: Error: Incompatible override, in line: override function
>>> toString
>>> () {
>>> line 126: Error: Incompatible override, in line: override function
>>> toString
>>> () {
>>>
>>>
>>> On Fri, May 2, 2008 at 11:40 PM, P T Withington <ptw at pobox.com>  
>>> wrote:
>>>
>>> The override us automatic, I think it is the public that is screwing
>>>> the
>>>> test case. If toString is not public it won't be invoked by  
>>>> implicit
>>>> string
>>>> conversions. So I declared it public in my patch that Max was  
>>>> testing.
>>>> But
>>>> the test must override but not declare public. I'm pretty sure  
>>>> that is
>>>> the
>>>> conflict.
>>>>
>>>>
>>>> On May 2, 2008, at 21:55, "Henry Minsky"  
>>>> <hminsky at laszlosystems.com>
>>>> wrote:
>>>>
>>>> Aren't the override keywords supposed to be inserted  
>>>> automatically ?
>>>> Do we need to declare toString on something in the lfc.lzx schema  
>>>> file
>>>> so
>>>> that the compiler
>>>> knows to insert an override?
>>>>
>>>> On Fri, May 2, 2008 at 5:18 PM, P T Withington < <ptw at pobox.com>
>>>> ptw at pobox.com> wrote:
>>>>
>>>> Well toString has to be a public override for it to work, so, I  
>>>> think
>>>>> the example will have to be updated.
>>>>>
>>>>>
>>>>> On May 2, 2008, at 14:09, Max Carlson < <max at openlaszlo.org>
>>>>> max at openlaszlo.org> wrote:
>>>>>
>>>>> Your example works, but
>>>>>
>>>>>> <http://localhost:8080/trunk/examples/modeexample.lzx?lzr=swf9>
>>>>>> http://localhost:8080/trunk/examples/modeexample.lzx?lzr=swf9 now
>>>>>> gives a compiler error:
>>>>>> org.openlaszlo.sc.CompilerError: line 366: Error: Incompatible
>>>>>> override, in line: override function toString () {
>>>>>>
>>>>>> P T Withington wrote:
>>>>>>
>>>>>> Change 20080502-ptw-H by ptw at dueling-banjos.home on 2008-05-02
>>>>>>> 06:48:32 EDT
>>>>>>> in /Users/ptw/OpenLaszlo/ringding-2/WEB-INF/lps/lfc
>>>>>>> for <http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc
>>>>>>>>
>>>>>>> http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/lfc
>>>>>>> Summary: Make handler trampoline work in swf9
>>>>>>> Bugs Fixed:
>>>>>>> LPP-5818 'Warn when methods registered for events aren't
>>>>>>> expecting
>>>>>>> exactly one argument from sendEvent()'
>>>>>>> Technical Reviewer: hminsky (pending)
>>>>>>> QA Reviewer: max (pending)
>>>>>>> Details:
>>>>>>> LzFormattter: Type and default args for swf9, work around
>>>>>>> switch
>>>>>>> verifier error (must have break on final case).
>>>>>>> *: toString must be public to have it seen by string coercion
>>>>>>> Tests:
>>>>>>> This now runs in swf9, demonstrating that the wrapper to handle
>>>>>>> the missing argument is being installed.
>>>>>>> <canvas>
>>>>>>>  <simplelayout />
>>>>>>>  <text name="output" clickable="true" text="Click Me!"/>
>>>>>>>  <method name="handleMe">
>>>>>>>    output.format("Clicked!");
>>>>>>>  </method>
>>>>>>>  <handler name="onclick" reference="output" method="handleMe"
>>>>>>> />
>>>>>>> </canvas>
>>>>>>> Files:
>>>>>>> M      kernel/swf/LzLibrary.lzs
>>>>>>> M      kernel/dhtml/LzLibrary.js
>>>>>>> M      services/LzURL.js
>>>>>>> M      services/LzIdle.lzs
>>>>>>> M      debugger/LzMemory.lzs
>>>>>>> M      core/LzMiniNode.lzs
>>>>>>> M      core/LzNode.lzs
>>>>>>> M      views/LzText.lzs
>>>>>>> M      views/LaszloCanvas.lzs
>>>>>>> M      helpers/LzFont.lzs
>>>>>>> M      helpers/LzSelectionManager.lzs
>>>>>>> M      events/LaszloEvents.lzs
>>>>>>> M      controllers/LzAnimatorGroup.lzs
>>>>>>> M      controllers/LaszloLayout.lzs
>>>>>>> M      controllers/LaszloAnimation.lzs
>>>>>>> M      data/LzLazyReplicationManager.lzs
>>>>>>> M      data/LzReplicationManager.lzs
>>>>>>> M      data/LzDatapointer.lzs
>>>>>>> M      data/LzDataText.lzs
>>>>>>> M      data/LzDataElement.lzs
>>>>>>> M      data/LzDataset.lzs
>>>>>>> M      data/LzDatapath.lzs
>>>>>>> M      data/LzResizeReplicationManager.lzs
>>>>>>> M      data/LzParsedPath.lzs
>>>>>>> M      data/LzParam.lzs
>>>>>>> M      data/LzDataAttrBind.lzs
>>>>>>> M      compiler/LzFormatter.lzs
>>>>>>> Changeset:
>>>>>>> <http://svn.openlaszlo.org/openlaszlo/patches/20080502-ptw-H.tar
>>>>>>>>
>>>>>>> http://svn.openlaszlo.org/openlaszlo/patches/20080502-ptw-H.tar
>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> Max Carlson
>>>>>> OpenLaszlo.org
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> --
>>>> Henry Minsky
>>>> Software Architect
>>>> <hminsky at laszlosystems.com>hminsky at laszlosystems.com
>>>>
>>>>
>>>>
>>>
>>> --
>>> Henry Minsky
>>> Software Architect
>>> hminsky at laszlosystems.com
>>>
>>
>>
>
>
> -- 
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com



More information about the Laszlo-dev mailing list