If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler
NEW : You can now close your own issues and reopen them later if needed. You can also comment closed issues.
List of issues#2791 avm1: IIFE attempts
Author:
Randomno
RandomnoDate created:
Type: bug
Visibility: Everybody
Assigned to:
State: upgraded 

Compile this code in CS6:
function()
{
trace("hello");
}();
It will successfully compile to:
Push 0.0
DefineFunction "", 0 {
Push "hello"
Trace
}
CallFunction
Pop
FFDec does not compile this same code due to missing identifier.
FFDec and CS6 both successfully compile this:
(function()
{
trace("hello");
})();
But FFDec decompiles this without the additional parentheses resulting in the same issue
as case 1.
Neither of these seem to be real IIFEs and produce no trace output. It is possible though
with this bytecode:
Push 0.0
DefineFunction "", 0 {
Push "hello"
Trace
}
Push ""
CallMethod
Pop
This decompiles into case 1 in FFDec, so if that syntax were supported, it would recompile
differently. I'm not sure it actually has a valid AS equivalent.
I was unsure about the worth of reporting this, but the compilation/decompilation mismatch
in case 2 at least seems worth addressing since it happens fully within FFDec.
Turns out MTASC compiles it into the invoked version. So it's possible this got used in
real content?
GitHub commit - fix(as1/2 editor): allow unnamed functions (#2791)
Upcoming nightly version: 3709
Nightly version 3709 released.
In nightly 3709 I allowed empty function name so it behaves like CS6 now and I'd like to
stick with it.
State: new→upgraded
