Change 20080716-dda-V by [EMAIL PROTECTED] on 2008-07-16 21:26:41 EDT
    in /Users/dda/laszlo/src/svn/openlaszlo/trunk-a
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix remapLocals and withThis in SWF9

New Features:

Bugs Fixed: LPP-6637

Technical Reviewer: ptw (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
    The SWF9 code generator has had a long standing bug that prevented
the withThis pragma from working. This change set fixes the fundamental bug and other smaller problems in order to allow withThis to function properly.
    withThis is necessary for the new approach to handling states.

The code that disables the withThis from being operation has been removed.

The bug was an extra visit of the function - the second visit sees some artifacts left by the first visit, and gets confused. This has been fixed.

Mixins in SWF9 are handled by keeping the AST for the mixin and visiting it whenever it is mixed in. The visited AST was not a complete copy, only a shallow copy, and this exposed the same sort of extra visit bug.
    A deep copy function for SimpleNode (the basis for AST) was added.
This required minor changes to all existing handcoded AST classes to support deep copy. Fortunately there are not many of these classes,
    but if we add any, we'll need to implement the deepCopy() function.

Remapped formal arguments, (e.g. function foo(a, b) => function foo($1, $2)), must retain any ellipsis from the original declaration (e.g. function foo(a, ...b) => function foo($1, ...$2)) I am also retaining type info, (e.g. function foo(a:*, b) => function foo($1:*, $2))

Tests:
   Passes test case given by ptw in LPP-6637.
   Builds LFC without errors with withThis code enabled.
   Regression tests: smokecheck for swf8/dhtml.
   Unfortunately SWF9 hello seems broken (not due to this change),
   so unable to test that.

Files:
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/Compiler.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 M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ ASTOperator.java M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ ASTLiteral.java M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ ASTFormalParameterList.java M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ ASTIdentifier.java M WEB-INF/lps/server/sc/src/org/openlaszlo/sc/parser/ ASTPassthroughDirective.java

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080716-dda-V.tar



--

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

voice: 617-547-7881
email: [EMAIL PROTECTED]
www: http://www.ddanderson.com



Reply via email to