Do you need to add Function.bind() now, or can you add it in a separate
changeset? Also, do you need to check if someone else has already
defined function.bind(), e.g. in DHTML? I'm wary of hacking the
internals, even though we're adding functionality.
Otherwise approved!
Regards,
Max Carlson
OpenLaszlo.org
On 7/20/10 4:20 PM, P T Withington wrote:
Change 20100720-ptw-e by [email protected] on 2010-07-20 18:49:55 EDT
in /Users/ptw/OpenLaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Make presentation types singletons
Bugs Fixed:
LPP-7354 Presentation Types (partial)
LPP-8961 Replace delegates with method closures (partial, adding
Function/bind)
LPP-7086 SWF9 cannot print Function/method names (partial, deprecation
warnings)
Technical Reviewer: [email protected] or [email protected] (pending)
QA Reviewer: [email protected] (pending)
Overview:
I'm converting presentation types to singletons so they can better
take advantage of inheritance (in support of adding user<type>s).
Details:
LzDebug: Add a new internal API methodName that computes a method
name from an instance and a method closure from that instance.
This API is defaulted on all runtimes other than AS3, where it
uses Andre's clever code to finde the method name by introspecting
the instance. Simplified the circular printer detector to cache
full descriptions (i.e., the representation and the readability
state of that representation), rather than only caching readable
representations. This gives a prettier output when printing an
object where the same object may show up many times, albeit not as
a circular reference. E.g.,
`Debug.inspect(lz.node.presentationtypes)`.
swf9/LzDebug: Add Andre's clever implementation of methodName.
LzNode: Remove stale compatibility code noted in passing. Remove
usage of DefaultPresentationType. Issue a warning if there is no
applicable presentation type.
PresentationTypes: Rewrite as singletons. Add some debug
printing support. Remove DefaultPresentationType.
LzRuntime: Add Function/bind to support bound methods in JS1 and
curried methods in AS3. Ensure bound methods can be printed
prettily by the debugger.
LzBootstrapDebugService: Use Debug.methodName to get
Debug.deprecated working on swf9/10.
basevaluecomponent: Change the default type to expression rather
than no type at all so you do not get a warning and presumably so
you get more what you intended.
Tests:
ant lztest, smokecheck,
docs/src/developers/programs/{colorswatch,csscolors}.lzx
Files:
M WEB-INF/lps/lfc/debugger/LzDebug.lzs
M WEB-INF/lps/lfc/debugger/platform/swf9/LzDebug.as
M WEB-INF/lps/lfc/core/LzNode.lzs
M WEB-INF/lps/lfc/core/PresentationTypes.lzs
M WEB-INF/lps/lfc/compiler/LzRuntime.lzs
M WEB-INF/lps/lfc/compiler/LzBootstrapDebugService.lzs
M lps/components/base/basevaluecomponent.lzx
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100720-ptw-e.tar