Permalink
Browse files

Fixes issue 116 where a write-only property was causing an illegal re…

…ad exception when encoded as JSON.
  • Loading branch information...
1 parent 3a6b628 commit 5525fe2dfaa7535f506af65804ff18014a691513 @darronschall darronschall committed Aug 15, 2009
@@ -275,9 +275,16 @@ package com.adobe.serialization.json
{
// Loop over all of the variables and accessors in the class and
// serialize them along with their values.
- for each ( var v:XML in classInfo..*.( name() == "variable" || name() == "accessor" ) )
+ for each ( var v:XML in classInfo..*.(
+ name() == "variable"
+ ||
+ (
+ name() == "accessor"
+ // Issue #116 - Make sure accessors are readable
+ && attribute( "access" ).charAt( 0 ) == "r" )
+ ) )
{
- // Issue #110 - If [Transient] metadata exists, then we should skip the var
+ // Issue #110 - If [Transient] metadata exists, then we should skip
if ( v.metadata && v.metadata.( @name == "Transient" ).length() > 0 )
{
continue;
@@ -73,6 +73,12 @@ package com.adobe.serialization.json
[Transient]
public var transientVar:String;
+
+ /** Write-only property */
+ public function set writeOnlyProp( value:Number ):void
+ {
+
+ }
}

0 comments on commit 5525fe2

Please sign in to comment.