Support Dictionary, too.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4972 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -29,6 +29,7 @@ import flash.geom.Rectangle;
|
|||||||
import flash.system.ApplicationDomain;
|
import flash.system.ApplicationDomain;
|
||||||
|
|
||||||
import flash.utils.ByteArray;
|
import flash.utils.ByteArray;
|
||||||
|
import flash.utils.Dictionary;
|
||||||
import flash.utils.Endian;
|
import flash.utils.Endian;
|
||||||
import flash.utils.IExternalizable;
|
import flash.utils.IExternalizable;
|
||||||
import flash.utils.getQualifiedSuperclassName; // function import
|
import flash.utils.getQualifiedSuperclassName; // function import
|
||||||
@@ -146,6 +147,20 @@ public class ObjectMarshaller
|
|||||||
}
|
}
|
||||||
// then, continue on with the sub-properties check (below)
|
// then, continue on with the sub-properties check (below)
|
||||||
|
|
||||||
|
} else if (value is Dictionary) {
|
||||||
|
if (ClassUtil.getClassName(value) != "flash.utils.Dictionary") {
|
||||||
|
return "Custom Dictionary subclasses are not supported";
|
||||||
|
}
|
||||||
|
// check all the keys
|
||||||
|
for (var key :* in value) {
|
||||||
|
var se :String = getValidationError(key);
|
||||||
|
if (se != null) {
|
||||||
|
return se;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// then, continue on with sub-property check (below)
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var type :String = typeof(value);
|
var type :String = typeof(value);
|
||||||
if (type == "number" || type == "string" || type == "boolean" ) {
|
if (type == "number" || type == "string" || type == "boolean" ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user