[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 13:28:20 PDT 2008
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20080922/5aa0d17b/attachment-0001.html
More information about the Laszlo-dev
mailing list