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


The following commit(s) were added to refs/heads/develop by this push:
     new 7d35765  Crux Fix for ApplicationBase not used in MXRoyale or 
SparkRoyale Application base classes. Switch to use IFlexInfo as the 
application marker.
7d35765 is described below

commit 7d35765a88634031860cebbead3eed1ebff1e3fc
Author: greg-dove <greg.d...@gmail.com>
AuthorDate: Wed Oct 30 17:05:57 2019 +1300

    Crux Fix for ApplicationBase not used in MXRoyale or SparkRoyale 
Application base classes. Switch to use IFlexInfo as the application marker.
---
 frameworks/projects/Crux/pom.xml                   | 14 +++++++++++++
 .../royale/org/apache/royale/crux/BeanFactory.as   |  6 +++---
 .../royale/org/apache/royale/crux/BeanProvider.as  | 11 ++++++++++-
 .../royale/org/apache/royale/crux/CruxManager.as   |  5 ++---
 .../org/apache/royale/crux/beads/JSStageEvents.as  |  2 --
 .../royale/crux/utils/view/applicationContains.as  | 10 +++++++---
 .../crux/utils/view/simulatedSingleEnterFrame.as   | 23 +++++++++++-----------
 7 files changed, 48 insertions(+), 23 deletions(-)

diff --git a/frameworks/projects/Crux/pom.xml b/frameworks/projects/Crux/pom.xml
index 6d6eb74..7dc69c8 100644
--- a/frameworks/projects/Crux/pom.xml
+++ b/frameworks/projects/Crux/pom.xml
@@ -79,6 +79,13 @@
               </dependency>
               <dependency>
                   <groupId>org.apache.royale.framework</groupId>
+                  <artifactId>Basic</artifactId>
+                  <version>0.9.7-SNAPSHOT</version>
+                  <type>swc</type>
+                  <classifier>swf</classifier>
+              </dependency>
+              <dependency>
+                  <groupId>org.apache.royale.framework</groupId>
                   <artifactId>Reflection</artifactId>
                   <version>0.9.7-SNAPSHOT</version>
                   <type>swc</type>
@@ -151,6 +158,13 @@
     </dependency>
     <dependency>
       <groupId>org.apache.royale.framework</groupId>
+      <artifactId>Basic</artifactId>
+      <version>0.9.7-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>js</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
       <artifactId>Language</artifactId>
       <version>0.9.7-SNAPSHOT</version>
       <type>swc</type>
diff --git 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/BeanFactory.as
 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/BeanFactory.as
index 4c731a8..cb3b4c2 100644
--- 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/BeanFactory.as
+++ 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/BeanFactory.as
@@ -15,7 +15,7 @@
  */
 package org.apache.royale.crux
 {
-       import org.apache.royale.core.ApplicationBase;
+       import org.apache.royale.core.IFlexInfo;
        import org.apache.royale.core.IRoyaleElement;
        import org.apache.royale.core.UIBase;
        COMPILE::SWF{
@@ -508,7 +508,7 @@ package org.apache.royale.crux
                                        if( removedDisplayObjects.length == 0 )
                                        {
                                                //like 'removing' enterframe 
event listener...
-                                               
simulatedSingleEnterFrame(ApplicationBase(crux.dispatcher), enterFrameHandler, 
true);
+                                               
simulatedSingleEnterFrame(IFlexInfo(crux.dispatcher), enterFrameHandler, true);
                                                isListeningForEnterFrame = 
false;
                                        }
                                        
@@ -570,7 +570,7 @@ package org.apache.royale.crux
                        if( !isListeningForEnterFrame )
                        {
                                //crux.dispatcher.addEventListener( 
Event.ENTER_FRAME, enterFrameHandler, false, 0, true );
-                               
simulatedSingleEnterFrame(ApplicationBase(crux.dispatcher), enterFrameHandler, 
false);
+                               
simulatedSingleEnterFrame(IFlexInfo(crux.dispatcher), enterFrameHandler, false);
                                isListeningForEnterFrame = true;
                        }
                 }
diff --git 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/BeanProvider.as
 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/BeanProvider.as
index a0bcc29..aead844 100644
--- 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/BeanProvider.as
+++ 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/BeanProvider.as
@@ -115,7 +115,16 @@ package org.apache.royale.crux
                                {
                                        // BeanProvider will take care of 
setting the type descriptor,
                                        // but we want to wrap the instances in 
Bean classes to set the Bean.name to id
-                                       child = varDef.getValue(inspect);
+                                       if (name == 'model') { // accessing 
Royale model accessor can throw an error if it is not set and there is not css 
value supplied
+                                               try{
+                                                       child = 
varDef.getValue(inspect);
+                                               } catch(e:Error) {
+                                                       child = null;
+                                               }
+                                       } else {
+                                               child = 
varDef.getValue(inspect);
+                                       }
+                                       
                                        if(child != null)
                                        {
                                                found = false;
diff --git 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/CruxManager.as
 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/CruxManager.as
index ea3688c..b4802d2 100644
--- 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/CruxManager.as
+++ 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/CruxManager.as
@@ -15,8 +15,7 @@
  */
 package org.apache.royale.crux
 {
-
-       import org.apache.royale.core.ApplicationBase;
+       import org.apache.royale.core.IFlexInfo;
        import org.apache.royale.core.UIBase;
        import org.apache.royale.crux.processors.IProcessor;
     import org.apache.royale.crux.processors.IMetadataProcessor;
@@ -85,7 +84,7 @@ package org.apache.royale.crux
                        {
                                var crux:ICrux = ICrux( cruxes[ i ] );
 
-                               if (applicationContains(ApplicationBase( 
crux.dispatcher ), view))
+                               if (applicationContains(IFlexInfo( 
crux.dispatcher ), view))
                                {
                                        setUpView( view, crux );
                                        return;
diff --git 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/beads/JSStageEvents.as
 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/beads/JSStageEvents.as
index 13136bb..9ab96f0 100644
--- 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/beads/JSStageEvents.as
+++ 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/beads/JSStageEvents.as
@@ -27,8 +27,6 @@ package org.apache.royale.crux.beads
     import org.apache.royale.events.Event;
     import org.apache.royale.events.EventDispatcher;
     import org.apache.royale.events.IEventDispatcher;
-    import org.apache.royale.core.IRenderedObject;
-    import org.apache.royale.core.ApplicationBase;
     import org.apache.royale.core.UIBase;
     
     COMPILE::JS {
diff --git 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/utils/view/applicationContains.as
 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/utils/view/applicationContains.as
index a07a1e2..73b5cc1 100644
--- 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/utils/view/applicationContains.as
+++ 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/utils/view/applicationContains.as
@@ -23,12 +23,16 @@
 package org.apache.royale.crux.utils.view {
 
        import org.apache.royale.core.UIBase;
-       import org.apache.royale.core.ApplicationBase;
+       import org.apache.royale.core.IFlexInfo;
 
        COMPILE::SWF{
                import flash.display.DisplayObjectContainer;
                import flash.display.DisplayObject;
        }
+    
+    COMPILE::JS{
+        import org.apache.royale.core.HTMLElementWrapper;
+    }
 
 
        /**
@@ -40,7 +44,7 @@ package org.apache.royale.crux.utils.view {
         *
         * @royaleignorecoercion org.apache.royale.core.HTMLElementWrapper
         */
-       public function applicationContains(container:ApplicationBase, 
content:UIBase):Boolean {
+       public function applicationContains(container:IFlexInfo, 
content:UIBase):Boolean {
                if (!content) return false;
                if (!container) return false;
                COMPILE::SWF{
@@ -48,7 +52,7 @@ package org.apache.royale.crux.utils.view {
                }
 
                COMPILE::JS{
-                       return container.element.contains(content.element)
+                       return 
HTMLElementWrapper(container).element.contains(content.element)
                }
 
        }
diff --git 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/utils/view/simulatedSingleEnterFrame.as
 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/utils/view/simulatedSingleEnterFrame.as
index 04e13b2..a50b994 100644
--- 
a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/utils/view/simulatedSingleEnterFrame.as
+++ 
b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/utils/view/simulatedSingleEnterFrame.as
@@ -21,13 +21,13 @@
  * Swiz Framework library by Chris Scott, Ben Clinkinbeard, Sönke Rohde, John 
Yanarella, Ryan Campbell, and others https://github.com/swiz/swiz-framework
  */
 package org.apache.royale.crux.utils.view {
-
-
-       import org.apache.royale.core.ApplicationBase;
+       
+       import org.apache.royale.core.IFlexInfo;
 
        COMPILE::SWF{
-
                import flash.events.Event;
+               import flash.display.DisplayObjectContainer;
+               import flash.display.DisplayObject;
        }
 
 
@@ -40,17 +40,17 @@ package org.apache.royale.crux.utils.view {
         *
         * @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
         */
-       public function simulatedSingleEnterFrame(container:ApplicationBase, 
callback:Function, removeOnly:Boolean = false):void {
+       public function simulatedSingleEnterFrame(container:IFlexInfo, 
callback:Function, removeOnly:Boolean = false):void {
                if (!container) return ;
                COMPILE::SWF{
 
                        var listener:Function = Support.map[container];
                        if (listener != null) {
-                               
container.removeEventListener(Event.ENTER_FRAME, listener);
+                               
DisplayObjectContainer(container).removeEventListener(Event.ENTER_FRAME, 
listener);
                        }
                        if (!removeOnly) {
                                Support.map[container] = 
Support.getListener(callback, container);
-                               container.addEventListener(Event.ENTER_FRAME, 
Support.map[container]);
+                               
DisplayObjectContainer(container).addEventListener(Event.ENTER_FRAME, 
Support.map[container]);
                        }
 
                }
@@ -67,10 +67,11 @@ package org.apache.royale.crux.utils.view {
        }
 }
 
-import org.apache.royale.core.ApplicationBase;
+import org.apache.royale.core.IFlexInfo;
 COMPILE::SWF{
        import flash.utils.Dictionary;
        import flash.events.Event;
+       import flash.events.EventDispatcher;
 }
 
 class Support {
@@ -82,7 +83,7 @@ class Support {
        public static const map:Dictionary = new Dictionary();
 
        COMPILE::JS
-       public static function getListener(callback:Function, 
container:ApplicationBase):Function {
+       public static function getListener(callback:Function, 
container:IFlexInfo):Function {
                return function(timeStamp:Number):void{
                                Support.map.delete(container);
                                callback();
@@ -91,9 +92,9 @@ class Support {
        }
 
        COMPILE::SWF
-       public static function getListener(callback:Function, 
container:ApplicationBase):Function {
+       public static function getListener(callback:Function, 
container:IFlexInfo):Function {
                var f:Function = function(e:Event):void{
-                               
container.removeEventListener(Event.ENTER_FRAME, f);
+                               
EventDispatcher(container).removeEventListener(Event.ENTER_FRAME, f);
                                delete Support.map[container];
                                callback();
                        };

Reply via email to