-
Notifications
You must be signed in to change notification settings - Fork 13
Description
The var access:String equates to an empty string when casting from the item.@access attribute. Thus, the conditional value of "access==null" is not met, preventing properties from being applied to public variables in a class.
for each( item in list )
{
access = item.@access;
if( access == "readwrite" || access == "writeonly" || access == null ) {
// access isn't null, it's an empty string
}
}
My quick-fix version at the moment:
for each( item in list )
{
access = item.@access;
if( access === "readwrite" || access === "writeonly" || access === "" )
}
Last I checked this with Flash CS4 compiler. I'm not sure though as casted string results might differ on different platforms . It might be better to do something like "item.@access == undefined" as the first condition...Or perhaps, simply check that the "item.name()=="variable", and if so, don't even bother with checking the "access" attribute, since there's won't be such an attribute anyway.
The old legacy Camo v2 implementation uses switch case(), which (though may be slower), clearly identifies two different cases for accessor vs. variable situations;
for each (item in list) {
var itemName : String = item.name().toString();
switch(itemName) {
case "variable":
propMap[item.@name.toString()] = item.@type.toString();
break;
case "accessor":
var access : String = item.@access;
if ((access == "readwrite") || (access == "writeonly")) {
propMap[item.@name.toString()] = item.@type.toString();
}
break;
}