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

harbs 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 3689e37374 Check the type on adding to strand and not on every 
contentView access
3689e37374 is described below

commit 3689e373746cd0c21f7fc568be84481f17d7e699
Author: Harbs <[email protected]>
AuthorDate: Wed Dec 20 16:50:21 2023 +0200

    Check the type on adding to strand and not on every contentView access
---
 .../main/royale/org/apache/royale/html/beads/ContainerView.as | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ContainerView.as
 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ContainerView.as
index e9c6eec12c..ca4525ad00 100644
--- 
a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ContainerView.as
+++ 
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/ContainerView.as
@@ -39,6 +39,7 @@ package org.apache.royale.html.beads
        import org.apache.royale.html.supportClasses.Border;
        import org.apache.royale.html.supportClasses.Viewport;
        import org.apache.royale.utils.loadBeadFromValuesManager;
+       import org.apache.royale.debugging.assert;
 
        /**
         * This class creates and manages the contents of a Container. On the 
ActionScript
@@ -99,7 +100,7 @@ package org.apache.royale.html.beads
                 *  @playerversion Flash 10.2
                 *  @playerversion AIR 2.6
                 *  @productversion Royale 0.8
-                *  @royaleemitcoercion org.apache.royale.core.ILayoutView
+                *  @royaleignorecoercion org.apache.royale.core.ILayoutView
                 */
                override public function get contentView():ILayoutView
                {
@@ -151,9 +152,15 @@ package org.apache.royale.html.beads
                        if(!_viewport)
                                _viewport = 
loadBeadFromValuesManager(IViewport, "iViewport", _strand) as IViewport;
 
-                       if (_viewport) {
+                       if (_viewport)
+                       {
+                               assert(_viewport.contentView is 
ILayoutView,"The viewport is expected to be an ILayoutView");
                                addViewport();
                        }
+                       else
+                       {
+                               assert(host is ILayoutView,"When there's no 
viewport, the host must be an ILayoutView");
+                       }
                }
 
                /**

Reply via email to