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#2792 AS3: variables of Function type with default value turn into functions
Author:
Fancy2209
Fancy2209Date created:
Type: bug
Visibility: Everybody
Assigned to:
Labels: AS3
State: upgraded 

> What steps will reproduce the problem?
Trying to compile this script using JPEXS, or decompile a swf of it compiled with MXMLC
<code>
package {
import flash.display.Sprite;
[SWF(width="550",height="400",backgroundColor="#ffffff",frameRate="24")]
public class Main extends Sprite {
private var scrollEngine:Function = function():void {};
public function Main() {
super();
this.scrollEngine();
this.scrollEngine = function():void { trace("Hello, World!"); };
this.scrollEngine();
}
}
}
</code>
Will compile into
<code>
package
{
import flash.display.Sprite;
[SWF(width="550",height="400",backgroundColor="#ffffff",frameRate="24")]
public class Main extends Sprite
{
private function scrollEngine():void
{
}
public function Main()
{
super();
this.scrollEngine();
this.scrollEngine = function():void
{
trace("Hello, World!");
};
this.scrollEngine();
}
}
}
</code>
> What is the expected output? What do you see instead?
I'd expect scrollEngine to keep being a variable, and not a turn into a function, so the
recompiled swf doesn't throw an error.
> What version of the product are you using? Is it "nightly build"? Which operating system
do you have?
v26.5.0 nightly build 3717, EndeavourOS Linux
> Please provide any additional information below. If the problem is related to a SWF
file, attach it here, otherwise we can't help you.
GitHub commit - fix(as3): fix vars of type Function (#2792)
Upcoming nightly version: 3718
Nightly version 3718 released.
It is fixed in nightly 3718.
State: new→upgraded
