Skip to content

Private function outside of a package reported as a SlotOrConstantTrait  #50

Open
@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Create a SWC containing one file - a/b/var1.as - with the following content:

package a.b
{
  public var var1:int = func1();
}
function func1():int { return 1; }

2. Extract the SWF, and load as a byte array. Then use the following code to 
create an array of abcTags:
var data:ByteArray = // load the SWF into the byte array
var io:SWFFileIO = new SWFFileIO();
var swfFile:SWFFile = io.read(data);
var abcTags:Array = swfFile.getTagsByType(DoABCTag);

3. Examine the DoABCTag associated with var1.

What is the expected output? What do you see instead?
I would expect to see two traits in scriptInfo[0].traits. The first one ought 
to be a SlotOrConstantTrait containing details of var1. The second ought to be 
a MethodTrait containing details of func1.

Instead there are two SlotOrConstantTrait entries. The first is correct; the 
second contains details of func1, presented as a variable.

What version of the product are you using? On what operating system?
as3commons-bytecode-1.0-RC3.swc
as3commons-lang-0.3.2.swc
Windows 7, 64 bit. 

Please provide any additional information below.
I am testing this using an AIR application built using Flex SDK 4.5. I'm 
assuming this makes no difference to the structure of either the SWC or the way 
as3-commons behaves. Please let me know if it's worth me re-testing using 
another configuration.

Original issue reported on code.google.com by [email protected] on 6 Apr 2011 at 9:37

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions