royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-asjs] 08/11: The reviver works bottom up so you have to copy properties when replacing a plain object with a class
Date Mon, 19 Feb 2018 00:23:07 GMT
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 50d940ce9ecbf72ea628a520d08292b2c8a5f227
Author: Alex Harui <aharui@apache.org>
AuthorDate: Sun Feb 18 16:17:26 2018 -0800

    The reviver works bottom up so you have to copy properties when replacing a plain object
with a class
---
 .../main/royale/org/apache/royale/reflection/beads/JSONReviver.as   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/beads/JSONReviver.as
b/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/beads/JSONReviver.as
index 9ffabd2..77c674d 100644
--- a/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/beads/JSONReviver.as
+++ b/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/beads/JSONReviver.as
@@ -108,7 +108,11 @@ public class JSONReviver
             var c:Class = classMap[key];
             if (c)
             {
-                return new c();
+                var newValue:Object = new c();
+                for (var p:String in value)
+                {
+                    newValue[p] = value[p];
+                }
             }
         }
         return value;

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.

Mime
View raw message