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

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


The following commit(s) were added to refs/heads/feature/layout-optimization by 
this push:
     new 9ebd322  Removed more coercions
9ebd322 is described below

commit 9ebd322478d6325029c168eb1d8621d03e431b10
Author: Harbs <[email protected]>
AuthorDate: Tue Mar 27 12:36:12 2018 +0300

    Removed more coercions
---
 .../src/main/royale/org/apache/royale/core/UIBase.as | 12 ++++++++----
 .../org/apache/royale/core/UIHTMLElementWrapper.as   |  4 ++++
 .../org/apache/royale/events/EventDispatcher.as      |  2 +-
 .../org/apache/royale/utils/MXMLDataInterpreter.as   | 20 +++++++++++++++-----
 .../royale/org/apache/royale/utils/StringUtil.as     |  2 +-
 .../main/royale/org/apache/royale/utils/UIUtils.as   | 18 ++++++++++++++----
 .../main/royale/org/apache/royale/effects/Tween.as   |  2 ++
 .../apache/royale/effects/beads/ParallelPlayBead.as  |  6 ++++++
 .../apache/royale/effects/beads/SequencePlayBead.as  |  6 ++++++
 9 files changed, 57 insertions(+), 15 deletions(-)

diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
index 60cae37..b5f4dd1 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/UIBase.as
@@ -951,6 +951,7 @@ package org.apache.royale.core
          *  @playerversion AIR 2.6
          *  @productversion Royale 0.0
          *  @royaleignorecoercion Class
+         *  @royaleignorecoercion org.apache.royale.core.IBeadView
          */
         public function get view():IBeadView
         {
@@ -966,7 +967,7 @@ package org.apache.royale.core
         {
             if (_view != value)
             {
-                addBead(value as IBead);
+                addBead(value);
                 dispatchEvent(new Event("viewChanged"));
             }
         }
@@ -1140,7 +1141,9 @@ package org.apache.royale.core
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
-         *  @productversion Royale 0.0
+         *  @productversion Royale 0.9
+         *  @royaleignorecoercion org.apache.royale.core.IBeadModel
+         *  @royaleignorecoercion org.apache.royale.core.IBeadView
          */        
                override public function addBead(bead:IBead):void
                {
@@ -1158,7 +1161,7 @@ package org.apache.royale.core
                        bead.strand = this;
                        
                        if (isView) {
-                               IEventDispatcher(this).dispatchEvent(new 
Event("viewChanged"));
+                               dispatchEvent(new Event("viewChanged"));
                        }
                }
                
@@ -1460,7 +1463,8 @@ package org.apache.royale.core
          *  @langversion 3.0
          *  @playerversion Flash 10.2
          *  @playerversion AIR 2.6
-         *  @productversion Royale 0.0
+         *  @productversion Royale 0.9
+         *  @royaleignorecoercion org.apache.royale.core.IMeasurementBead
          */
                public function get measurementBead() : IMeasurementBead
                {
diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/UIHTMLElementWrapper.as
 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/UIHTMLElementWrapper.as
index bc2dc97..f472df1 100644
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/UIHTMLElementWrapper.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/UIHTMLElementWrapper.as
@@ -120,6 +120,9 @@ COMPILE::SWF
             return _model;
         }
         
+        /**
+         * @royaleignorecoercion org.apache.royale.core.IBead
+         */
         [Bindable("modelChanged")]
         public function set model(value:Object):void
         {
@@ -135,6 +138,7 @@ COMPILE::SWF
         
         /**
          * @param bead The new bead.
+         * @royaleignorecoercion org.apache.royale.core.IBeadModel
          */
         override public function addBead(bead:IBead):void
         {
diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/EventDispatcher.as
 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/EventDispatcher.as
index 6704855..b44d9a7 100644
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/events/EventDispatcher.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/events/EventDispatcher.as
@@ -80,7 +80,7 @@ package org.apache.royale.events
                                //event.target = _target;
                                if (event) {
                                        if (typeof event == "string") {
-                                               event = new Event(event as 
String);
+                                               event = new Event("" + event);
                                                event.target = _target;
                                                //console.log("created event 
from string ",event);
                                        }
diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/MXMLDataInterpreter.as
 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/MXMLDataInterpreter.as
index ab537d3..338f295 100644
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/MXMLDataInterpreter.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/MXMLDataInterpreter.as
@@ -77,7 +77,9 @@ public class MXMLDataInterpreter
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
-     *  @productversion Royale 0.0
+     *  @productversion Royale 0.9
+     *  @royaleignorecoercion Array
+     *  @royaleignorecoercion String
      */
     public static function generateMXMLObject(document:Object, 
data:Array):Object
     {
@@ -167,8 +169,13 @@ public class MXMLDataInterpreter
     }
     
     /**
-     * @royaleignorecoercion Function 
-     * @royaleignorecoercion org.apache.royale.core.IChild 
+     * @royaleignorecoercion Array
+     * @royaleignorecoercion Function
+     * @royaleignorecoercion String
+     * @royaleignorecoercion org.apache.royale.core.IChild
+     * @royaleignorecoercion org.apache.royale.core.IParent
+     * @royaleignorecoercion org.apache.royale.core.IStrand
+     * @royaleignorecoercion org.apache.royale.core.IBead
      */
     private static function initializeStrandBasedObject(document:Object, 
parent:IParent, comp:Object, data:Array, i:int):int
     {
@@ -333,7 +340,8 @@ public class MXMLDataInterpreter
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
-     *  @productversion Royale 0.0
+     *  @productversion Royale 0.9
+     *  @royaleignorecoercion org.apache.royale.core.IContainer
      */
     public static function generateMXMLInstances(document:Object, 
parent:IParent, data:Array):void
     {
@@ -359,8 +367,10 @@ public class MXMLDataInterpreter
      *  @langversion 3.0
      *  @playerversion Flash 10.2
      *  @playerversion AIR 2.6
-     *  @productversion Royale 0.0
+     *  @productversion Royale 0.9
+     *  @royaleignorecoercion Array
      *  @royaleignorecoercion Function
+     *  @royaleignorecoercion String
      */
     public static function generateMXMLProperties(host:Object, data:Array):void
     {
diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/StringUtil.as
 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/StringUtil.as
index 171c157..a8ed294 100644
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/StringUtil.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/StringUtil.as
@@ -92,7 +92,7 @@ package org.apache.royale.utils
                        var args:Array;
                        if (len === 1 && rest[0] is Array)
                        {
-                               args = rest[0] as Array;
+                               args = rest[0];
                                len = args.length;
                        }
                        else
diff --git 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
index b8f487a..c90458e 100644
--- 
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
+++ 
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
@@ -74,11 +74,18 @@ package org.apache.royale.utils
                 *  @langversion 3.0
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
-                *  @productversion Royale 0.0
+                *  @productversion Royale 0.9
+                *  @royaleignorecoercion org.apache.royale.core.IChild
                 */
                public static function findPopUpHost(start:IUIBase):IPopUpHost
                {
-                       while( start != null && !(start is IPopUpHost) && start 
is IChild ) {
+                       while( start && !(start is IPopUpHost) ) {
+                               // start.parent will be undefined in js if it's 
not an IChild and return null
+                               COMPILE::SWF
+                               {
+                                       if(!(start is IChild))
+                                               return null;
+                               }
                                start = IChild(start).parent as IUIBase;
                        }
                        
@@ -94,12 +101,15 @@ package org.apache.royale.utils
                 *  @langversion 3.0
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
-                *  @productversion Royale 0.0
+                *  @productversion Royale 0.9
+                *  @royaleignorecoercion org.apache.royale.core.IChild
+                *  @royaleignorecoercion org.apache.royale.core.IPopUpHost
                 */
                public static function removePopUp(popUp:IChild):void
                {
+                       //TODO (harbs) The loop appears to not be needed. If 
removeElement is being called, it seems like the IPopUpHost would be the direct 
parent.
                        var start:IParent = popUp.parent;
-                       while( start != null && !(start is IPopUpHost) && start 
is IChild ) {
+                       while(!(start is IPopUpHost)) {
                                start = IChild(start).parent;
                        }
                        (start as IPopUpHost).removeElement(popUp);
diff --git 
a/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/Tween.as
 
b/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/Tween.as
index 0b5d5d2..d2cdb74 100644
--- 
a/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/Tween.as
+++ 
b/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/Tween.as
@@ -192,6 +192,7 @@ public class Tween extends Effect
 
     /**
      *  @private
+     *  @royaleignorecoercion org.apache.royale.core.IEffectTimer
      */
     private static function addTween(tween:Tween):void
     {
@@ -225,6 +226,7 @@ public class Tween extends Effect
 
     /**
      *  @royaleignorecoercion org.apache.royale.effects.Tween
+     *  @royaleignorecoercion Number
      *  @private
      */
     private static function updateHandler(event:ValueEvent):void
diff --git 
a/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/beads/ParallelPlayBead.as
 
b/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/beads/ParallelPlayBead.as
index 2a2c29d..4f91083 100644
--- 
a/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/beads/ParallelPlayBead.as
+++ 
b/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/beads/ParallelPlayBead.as
@@ -36,6 +36,9 @@ package org.apache.royale.effects.beads
                        super();
                }
                
+               /**
+                * @royaleignorecoercion 
org.apache.royale.effects.ICompoundEffect
+                */
                public function set strand(value:IStrand):void
                {
                        host = value as ICompoundEffect;
@@ -61,6 +64,9 @@ package org.apache.royale.effects.beads
                        child.play();   
                }
                
+               /**
+                * @royaleignorecoercion 
org.apache.royale.events.IEventDispatcher
+                */
                private function effectEndHandler(event:Event):void
                {
                        (event.target as 
IEventDispatcher).removeEventListener(Effect.EFFECT_END, effectEndHandler);
diff --git 
a/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/beads/SequencePlayBead.as
 
b/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/beads/SequencePlayBead.as
index 585d77b..6d86112 100644
--- 
a/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/beads/SequencePlayBead.as
+++ 
b/frameworks/projects/Effects/src/main/royale/org/apache/royale/effects/beads/SequencePlayBead.as
@@ -36,6 +36,9 @@ package org.apache.royale.effects.beads
                        super();
                }
                
+               /**
+                * @royaleignorecoercion 
org.apache.royale.effects.ICompoundEffect
+                */
                public function set strand(value:IStrand):void
                {
                        host = value as ICompoundEffect;
@@ -59,6 +62,9 @@ package org.apache.royale.effects.beads
                        child.play();   
                }
                
+               /**
+                * @royaleignorecoercion 
org.apache.royale.events.IEventDispatcher
+                */
                private function effectEndHandler(event:Event):void
                {
                        (event.target as 
IEventDispatcher).removeEventListener(Effect.EFFECT_END, effectEndHandler);

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to