[Laszlo-dev] For Review: Change 20080922-dda-B Summary: Force all functions and vars in classes to be public when compiling in debug

Donald Anderson dda at ddanderson.com
Mon Sep 22 18:40:10 PDT 2008


Everything in the debug LFC is now public, so if you link against it,  
you must use the debug flag.

On Sep 22, 2008, at 7:51 PM, P T Withington wrote:

> Yeah with Don's patch you need it on to make the implicit public's  
> get emitted, I'm guessing.
>
> On 2008-09-22, at 19:38EDT, Henry Minsky wrote:
>
>> I had to turn on the debug flag when the eval compiler compiles an
>> expression, for some reason. Maybe because the signatures of stuff  
>> in the
>> LFC are different now.
>>
>> On Mon, Sep 22, 2008 at 7:29 PM, P T Withington <ptw at laszlosystems.com 
>> >wrote:
>>
>>> Fabulous.  Approved.
>>>
>>> You will have to amend swf9/LzDebug as I added another passthrough
>>> override.
>>>
>>> Please file as an improvement the following idea:
>>>
>>> 1) Go through the LFC and declare all properties that are not marked
>>> @access private as public.
>>> 2) Improve the public-for-debug mechanism to only work on LZX  
>>> code, and
>>> leave the LFC alone (i.e., don't public-ify non-public in the LFC)
>>> 3) Add an optional LFC developer build of the LFC that marks  
>>> everything in
>>> the LFC as public, for debugging the LFC.
>>>
>>>
>>> On 2008-09-22, at 16:28EDT, Donald Anderson wrote:
>>>
>>> Change 20080922-dda-B by dda at lester.local on 2008-09-22 15:42:21 EDT
>>>> in /Users/dda/laszlo/src/svn/openlaszlo/trunk-a
>>>> for http://svn.openlaszlo.org/openlaszlo/trunk
>>>>
>>>> Summary: Force all functions and vars in classes to be public when
>>>> compiling in debug
>>>>
>>>> New Features:
>>>>
>>>> Bugs Fixed: LPP-6996
>>>>
>>>> Technical Reviewer: ptw (pending)
>>>> QA Reviewer: (pending)
>>>> Doc Reviewer: (pending)
>>>>
>>>> Documentation:
>>>>
>>>> Release Notes:
>>>>
>>>> Details:
>>>> The new 'publicizing' behavior triggers on the "DEBUG" option  
>>>> (which is
>>>> converted internally to "DEBUG_SWF9"
>>>> internally) and is specifically disabled by the
>>>> "DISABLE_PUBLIC_FOR_DEBUG" option.
>>>> Thus, compiling via lzc with the -g turns 'publicizing' on, and  
>>>> the SWF9
>>>> debug LFC is compiled
>>>> with 'publicized' methods. and vars.
>>>>
>>>> When publicizing, a method/var is publicized no matter how it is  
>>>> declared
>>>> (public/private/protected or nothing),
>>>> so long as it is a child of a 'class' definition.
>>>>
>>>> Part of the change was to modify ParseTreePrinter and
>>>> SWF9ParseTreePrinter to not have
>>>> increasingly complex constructors for every little option, but  
>>>> each now
>>>> has a Config class
>>>> that is used for constructor options.  Considered using
>>>> Compiler.OptionMap, but it's nice
>>>> for *ParseTreePrinter to be more self contained and encapsulated.
>>>>
>>>> JavascriptGenerator.java:
>>>> Use the new Config object
>>>>
>>>> SWF9Generator.java:
>>>> Use the new Config object
>>>> get the new 'forcePublicMembers' config entry from DEBUG  
>>>> (overridden via
>>>> DISABLE_PUBLIC_FOR_DEBUG)
>>>>
>>>> ParseTreePrinter.java:
>>>> Add/use new Config class
>>>>
>>>> SWF9ParseTreePrinter.java:
>>>> Add/use new Config class
>>>> Pass forcePublicMembers for children of a class definition
>>>>
>>>> Compiler.java:
>>>> Add -DdisablePublicForDebug
>>>>
>>>> parser/SimpleNode.java
>>>> expose parent as a SimpleNode.
>>>>
>>>> parser/ASTModifiedDefinition
>>>> override access to print 'public' as appropriate.
>>>>
>>>> lfc/debugger/platform/swf9/LzDebug.as:
>>>> LzAS3DebugService.objectOwnProperties needs to be declared public  
>>>> since
>>>> it is overriding a function
>>>> that is now public (not private).  Normally this is handled by the
>>>> mechanism above, but
>>>> this function declaration is in a #passthrough entry, so  
>>>> everything is
>>>> passed verbatim.
>>>>
>>>> Tests:
>>>> Regression: SWF8,DHTML smokecheck  (SWF8 currently has 3 errors,  
>>>> as it
>>>> does without this changeset).
>>>> weather SWF8,DHTML,SWF9  debug/non-debug
>>>>
>>>> compiled weather.lzx from command line (lzc -g) and (lzc -g
>>>> -DdisablePublicForDebug) to
>>>> confirm that one forces public and the other does not -- by  
>>>> looking at
>>>> output files.
>>>> lzc -g -DdisablePublicForDebug has many errors because of  
>>>> overrides that
>>>> do not
>>>> match public access in LFC9-debug.swc .  We'd need to make a  
>>>> special
>>>> library
>>>> built the same way to make this a useful option.
>>>>
>>>> Files:
>>>> M      WEB-INF/lps/lfc/debugger/platform/swf9/LzDebug.as
>>>> M      WEB-INF/lps/server/src/org/openlaszlo/sc/ 
>>>> JavascriptGenerator.java
>>>> M      WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
>>>> M      WEB-INF/lps/server/src/org/openlaszlo/sc/ 
>>>> SWF9ParseTreePrinter.java
>>>> M      WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
>>>> M      WEB-INF/lps/server/src/org/openlaszlo/sc/ 
>>>> ParseTreePrinter.java
>>>> M      WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ 
>>>> SimpleNode.java
>>>> M
>>>> WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ 
>>>> ASTModifiedDefinition.java
>>>>
>>>> Changeset:
>>>> http://svn.openlaszlo.org/openlaszlo/patches/20080922-dda-B.tar
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Don Anderson
>>>> Java/C/C++, Berkeley DB, systems consultant
>>>>
>>>> voice: 617-547-7881
>>>> email: dda at ddanderson.com
>>>> www: http://www.ddanderson.com
>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>> -- 
>> Henry Minsky
>> Software Architect
>> hminsky at laszlosystems.com
>


--

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

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



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080922/f27f26b0/attachment-0001.html


More information about the Laszlo-dev mailing list