royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [royale-asjs] 09/09: use to get tests to pass
Date Sun, 05 Aug 2018 01:18:34 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 6ebab10f321a28c64c779f93732ed6630f750d6c
Author: Alex Harui <aharui@apache.org>
AuthorDate: Sat Aug 4 18:18:03 2018 -0700

    use  to get tests to pass
---
 .../projects/MXRoyale/src/main/royale/mx/controls/MenuBar.as     | 9 ++++++++-
 mustella/src/main/royale/UnitTester.as                           | 6 +++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/MenuBar.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/MenuBar.as
index 619d710..5a990ce 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/MenuBar.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/MenuBar.as
@@ -939,7 +939,14 @@ public class MenuBar extends UIComponent implements IFocusManagerComponent,
ICon
     public function get menuBarItems():Array
     {
         var arr:Array = [];
-        var itemHolder:UIBase = getChildAt(0) as UIBase;
+        COMPILE::SWF
+        {
+            var itemHolder:UIBase = $getChildAt(0) as UIBase;
+        }
+        COMPILE::JS
+        {
+            var itemHolder:UIBase = getChildAt(0) as UIBase;            
+        }
         var n:int = itemHolder.numElements;
         for (var i:int = 0; i < n; i++)
             arr.push(itemHolder.getElementAt(i));
diff --git a/mustella/src/main/royale/UnitTester.as b/mustella/src/main/royale/UnitTester.as
index 1bdbd84..49ee2bb 100644
--- a/mustella/src/main/royale/UnitTester.as
+++ b/mustella/src/main/royale/UnitTester.as
@@ -1150,7 +1150,11 @@ public class UnitTester extends EventDispatcher
 						var n:int = doc.numChildren;
 						for (var i:int = 0; i < n; i++)
 						{
-							var child:DisplayObject = doc.getChildAt(i);
+							var child:DisplayObject;
+                            if ("$getChildAt" in doc)
+                                child = doc["$getChildAt"](i);
+                            else
+                                child = doc.getChildAt(i);
 							if (swfLoaders[doc] && child is flash.display.Loader)
 							{
 								// if sandboxed then ask it for its targets


Mime
View raw message