You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2020/10/07 21:07:44 UTC

[royale-asjs] 02/04: Make constructorMethod consistent between swf and js.

This is an automated email from the ASF dual-hosted git repository.

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

commit 26cb1509e53ee3c54f92f2a6c2f9ee13a9987e67
Author: greg-dove <gr...@gmail.com>
AuthorDate: Thu Oct 8 10:05:42 2020 +1300

    Make constructorMethod consistent between swf and js.
---
 .../main/royale/org/apache/royale/reflection/MethodDefinition.as    | 4 ++++
 .../src/main/royale/org/apache/royale/reflection/TypeDefinition.as  | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/MethodDefinition.as b/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/MethodDefinition.as
index 6b40f98..77daebb 100755
--- a/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/MethodDefinition.as
+++ b/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/MethodDefinition.as
@@ -43,12 +43,16 @@ package org.apache.royale.reflection
          */
         public function get declaredBy():TypeDefinition
         {
+            /* possible alternate here, @todo review:
+                return owner;
+            */
             COMPILE::SWF{
                 var declareBy:String = _rawData.@declaredBy;
             }
             COMPILE::JS{
                 var declareBy:String = _rawData.declaredBy;
             }
+
             return TypeDefinition.internalGetDefinition(declareBy);
         }
 
diff --git a/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/TypeDefinition.as b/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/TypeDefinition.as
index 7ed7890..a7d3415 100755
--- a/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/TypeDefinition.as
+++ b/frameworks/projects/Reflection/src/main/royale/org/apache/royale/reflection/TypeDefinition.as
@@ -332,6 +332,12 @@ COMPILE::SWF {
                             break;
                         }
                     }
+                    if (!_constructorMethod) {
+                        //constructor with no params
+                        _constructorMethod =
+                                new MethodDefinition(_name, false, this, { type: '', declaredBy: qualifiedName});
+
+                    }
                 }
             }