W00t!
On 2008-07-17, at 18:05EDT, Donald Anderson wrote:
Committed the changeset with a small fix. Some followup below....
On Jul 17, 2008, at 9:39 AM, Donald Anderson wrote:
On Jul 17, 2008, at 9:10 AM, P T Withington wrote:
Questions:
1) Do you need to copy default values for parameters, or is that
not stored on the parameter the way type and ellipsis is?
I think it already happens. Parameter names are ASTIdentifiers
and initializers are anything else (maybe ASTLiteral,
or an expression tree). This loop changes the ASTIdentifiers and
preserves the rest:
// Replace params
for (int i = 0, len = paramIds.length; i < len; i++) {
if (paramIds[i] instanceof ASTIdentifier) {
ASTIdentifier oldParam = (ASTIdentifier)paramIds[i];
SimpleNode newParam = translateReference(oldParam).declare();
params.set(i, newParam);
}
}
But I'll find a way to test this.
I saw several examples of this when debugging, so yes we are
emitting initializers.
2) The tag compiler will emit #pragma withThis in both functions
and methods. The either the swf9 back-end should turn that into a
no-op in a method (as it is redundant), or we can change the tag
compiler to _not_ emit that in methods, but then the swf8 and
dhtml back-ends will have to automatically insert it for methods.
I believe this will simply be an efficiency not a correctness
issue. If you want to defer, please file a separate bug. The
only way I know to test this would be to inspect the generated code.
Should be easy enough. We are already tracking when we are in a
declared class and also when we are in a declared method.
Is that enough? Do any closures (which might have #pragma
withThis) occur within a Class.Method body?
Filed LPP-6690 to cover this since it wasn't completely trivial.
3) I'd like to make sure at least _one_ of the known working swf9
tests works after this change. If hello is the test, we need to
get that working again first.
Agreed. Max got lzpix working, and it does not yet work with this
changeset, so I have some work to do to debug that.
A small change was needed when walking through args to create an
interstitial super -- needed to jump
over the Compiler.Passthrough nodes that had been generated due to
the withThis.
Now it passes lzpix and weather in SWF9, so I committed.
--
Donald Anderson
Systems Developer
[EMAIL PROTECTED]