You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/10/10 19:34:25 UTC

[royale-asjs] 13/16: handle primitive types

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 04aedcef5c8f6d1b47636a242a44725af7c43181
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Oct 10 11:40:06 2018 -0700

    handle primitive types
---
 .../org/apache/royale/reflection/getQualifiedClassName.as      | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/getQualifiedClassName.as b/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/getQualifiedClassName.as
index 67a6e89..b4a3437 100755
--- a/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/getQualifiedClassName.as
+++ b/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/getQualifiedClassName.as
@@ -39,10 +39,18 @@ COMPILE::SWF
         }
         COMPILE::JS
         {
+            var defName:String = typeof(value);
+            if (defName === "string") return "String";
+            if (defName === "number") return "Number";
+            if (defName === "boolean") return "Boolean";
+            if (defName === "undefined") return null;
+            if (value === null) return null;
+            if (Array.isArray(value)) return "Array";
+            
             if (value.ROYALE_CLASS_INFO == null)
             {
                 if (value.prototype.ROYALE_CLASS_INFO == null)
-                    return null;
+                    return "Object";
                 value = value.prototype;
             }
             return value.ROYALE_CLASS_INFO.names[0].qName;