Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

as3commons-bytecode - issue creating metadata against accessors #147

Open
GoogleCodeExporter opened this issue Mar 13, 2016 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

as3commons-bytecode does not appear to create metadata definitions against 
accessors.

What steps will reproduce the problem?

(the following code is based on that described at: 
http://www.as3commons.org/as3-commons-bytecode/emit.html)


                                                                var abcBuilder:IAbcBuilder = new AbcBuilder();
                                                                var packageBuilder:IPackageBuilder = abcBuilder.definePackage("com.classes.generated");

                                                                var classBuilder:IClassBuilder = packageBuilder.defineClass("RuntimeClass");

                                                                var accessorBuilder:IAccessorBuilder = classBuilder.defineAccessor("name","String","default");

                                                                var metadataBuilder:IMetadataBuilder = accessorBuilder.defineMetadata("PropertyLevel");
                                                                var metadataArgument:MetadataArgument = metadataBuilder.defineArgument();
                                                                metadataArgument.key = "key";
                                                                metadataArgument.value = "value";

                                                                abcBuilder.addEventListener(Event.COMPLETE, loadedHandler);
                                                                abcBuilder.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
                                                                abcBuilder.addEventListener(IOErrorEvent.VERIFY_ERROR, errorHandler);

                                                                abcBuilder.buildAndLoad();
                                                }


                                                private function loadedHandler(event:Event):void {
                                                                var clazz:Class = ApplicationDomain.currentDomain.getDefinition("com.classes.generated.RuntimeClass") as Class;
                                                                var instance:Object = new clazz();

                                                                trace(describeType(clazz));

                                                }

                                                private function errorHandler(event:Event):void {
                                                }


What is the expected output? What do you see instead?

I'm seeing the following output:

<type name="com.classes.generated::RuntimeClass" base="Class" isDynamic="true" 
isFinal="true" isStatic="true">
  <extendsClass type="Class"/>
  <extendsClass type="Object"/>
  <accessor name="prototype" access="readonly" type="*" declaredBy="Class"/>
  <factory type="com.classes.generated::RuntimeClass">
    <extendsClass type="Object"/>
    <accessor name="name" access="readwrite" type="String" declaredBy="com.classes.generated::RuntimeClass"/>
  </factory>
</type>

I'm expecting to see a metadata definition as a child of the <accessor> 
instance (these appear as expected when I modify the above code to generate a 
Property rather than an Accessor). 

What version of the product are you using? On what operating system?
as3commons-bytecode: 1.1.1
as3commons-reflect 1.6.4
as3commons-logging 2.7
as3commons-lang 0.3.7

O/S: Windows 7 x64
Flash Player 16.0.0.296
Browser: Firefox 36.0.1


Please provide any additional information below.

Any help is greatly appreciated!

Original issue reported on code.google.com by [email protected] on 13 Mar 2015 at 12:31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant