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 2019/05/23 07:05:36 UTC

[royale-asjs] branch improvements/Language updated (99b6c63 -> adfc975)

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

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


    from 99b6c63  Merge branch 'develop' into improvements/Language
     add e8d8f91  blog-examples: preparing project for next example
     add 81c97b7  Added CollectionChangeUpdateForArrayListData to Basic
     add 3be398a  Add Moonshine IDE project file to ASDoc
     new 6a85857  Merge branch 'develop' into improvements/Language
     new f270157  Add js-release output to HelloWorld maven build
     new bc4bf05  minor Vector optimizations
     new beac5c6  Vector improvements and optimizations (runtime performance, output footprint)
     new bce6ba5  refactor private beads to correspond to different requirements between targets
     new 87961c6  tweaks to build settings to use new line separations support in the additionalCompilerOptions
     add 1902fdd  Use a template method for visual display so renderer can more easily be extened
     add a72427a  jewel: correct some doc comments
     add e884f20  frameworks: library unit tests use <royaleunit> Ant task instead of <flexunit> Ant task
     add 26b4376  RoyaleUnit: CIListener uses WebSocket in JavaScript
     add d2c7d3f  Tests: some tweaks necessary to get library tests building/running in JS
     add 5f6242e  removed ace-config.xml from repository because it is automatically generated like the other -config.xml files
     add e18d7d7  Build files for JS libraries find the compilers the same way as the build files for SWF libraries
     add e7824c6  Added test target to Ant builds for JS libraries
     add b54e30c  BasicJS, CoreJS, RoyaleUnitJS: enabled RoyaleUnit tests
     add c9943e1  Tests for JS libraries use Chrome or Firefox on macOS, if available
     new adfc975  Merge branch 'develop' into improvements/Language

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore                                         |   1 +
 ..._javascript_libraries_in_Apache_Royale.as3proj} |   4 +-
 .../README.txt                                     |   0
 .../asconfig.json                                  |   5 +-
 .../build.xml                                      |   3 +-
 .../pom.xml                                        |   6 +-
 .../resources/jewel-example-index-template.html    |   0
 ...rnal_javascript_libraries_in_Apache_Royale.mxml |  65 ++++
 .../src/main/royale/hljs.as                        |   0
 .../ASDoc/ASDoc.as3proj}                           |  66 ++--
 examples/royale/HelloWorld/pom.xml                 |  15 +
 frameworks/ace-config.xml                          | 347 ---------------------
 frameworks/build.xml                               |  14 +-
 frameworks/js/projects/AceJS/build.xml             |  51 +--
 frameworks/js/projects/BasicJS/build.xml           |  51 +--
 .../projects/BasicJS}/src/test/royale/build.xml    |  96 +++---
 frameworks/js/projects/BindingJS/build.xml         |  51 +--
 frameworks/js/projects/ChartsJS/build.xml          |  51 +--
 frameworks/js/projects/CollectionsJS/build.xml     |  51 +--
 frameworks/js/projects/CoreJS/build.xml            |  51 +--
 .../projects/CoreJS}/src/test/royale/build.xml     |  96 +++---
 frameworks/js/projects/CreateJSJS/build.xml        |  51 +--
 frameworks/js/projects/DragDropJS/build.xml        |  51 +--
 frameworks/js/projects/EffectsJS/build.xml         |  51 +--
 frameworks/js/projects/ExpressJS/build.xml         |  51 +--
 frameworks/js/projects/FlatJS/build.xml            |  51 +--
 frameworks/js/projects/FontAwesomeJS/build.xml     |  51 +--
 frameworks/js/projects/FormattersJS/build.xml      |  51 +--
 frameworks/js/projects/GoogleMapsJS/build.xml      |  51 +--
 frameworks/js/projects/GraphicsJS/build.xml        |  51 +--
 frameworks/js/projects/HTML5JS/build.xml           |  51 +--
 frameworks/js/projects/HTMLJS/build.xml            |  51 +--
 frameworks/js/projects/IconsJS/build.xml           |  51 +--
 frameworks/js/projects/JQueryJS/build.xml          |  51 +--
 frameworks/js/projects/JewelJS/build.xml           |  51 +--
 frameworks/js/projects/LanguageJS/build.xml        |  51 +--
 frameworks/js/projects/MXRoyaleJS/build.xml        |  51 +--
 .../js/projects/MaterialDesignLiteJS/build.xml     |  51 +--
 frameworks/js/projects/MobileJS/build.xml          |  51 +--
 frameworks/js/projects/NetworkJS/build.xml         |  51 +--
 frameworks/js/projects/ReflectionJS/build.xml      |  51 +--
 frameworks/js/projects/RoyaleSiteJS/build.xml      |  51 +--
 frameworks/js/projects/RoyaleUnitJS/build.xml      |  51 +--
 .../RoyaleUnitJS}/src/test/royale/build.xml        |  96 +++---
 frameworks/js/projects/SparkRoyaleJS/build.xml     |  51 +--
 frameworks/js/projects/StorageJS/build.xml         |  51 +--
 frameworks/js/projects/TLFJS/build.xml             |  51 +--
 frameworks/js/projects/TextJS/build.xml            |  51 +--
 frameworks/js/projects/XMLJS/build.xml             |  55 ++--
 .../Basic/src/main/resources/basic-manifest.xml    |   1 +
 .../main/royale/org/apache/royale/core/UIBase.as   |  99 +-----
 .../CollectionChangeUpdateForArrayListData.as      |   2 +-
 .../html/supportClasses/ColorItemRenderer.as       |  36 +--
 .../royale/FlexUnitRoyaleApplication-config.xml    |  27 +-
 .../src/test/royale/FlexUnitRoyaleApplication.mxml |  11 +-
 .../projects/Basic/src/test/royale/build.xml       |  37 +--
 frameworks/projects/Core/pom.xml                   |   9 +-
 .../org/apache/royale/core/HTMLElementWrapper.as   | 112 ++++++-
 .../royale/FlexUnitRoyaleApplication-config.xml    |  29 +-
 .../src/test/royale/FlexUnitRoyaleApplication.mxml |  11 +-
 frameworks/projects/Core/src/test/royale/build.xml |  37 +--
 .../main/royale/org/apache/royale/jewel/Grid.as    |   2 +-
 .../main/royale/org/apache/royale/jewel/TabBar.as  |   2 +-
 .../royale/org/apache/royale/utils/Language.as     | 313 ++++++++++++-------
 .../src/main/royale/RoyaleUnitClasses.as           |   6 +-
 .../org/apache/royale/test/listeners/CIListener.as | 102 +++++-
 .../royale/FlexUnitRoyaleApplication-config.xml    |  27 +-
 .../src/test/royale/FlexUnitRoyaleApplication.mxml |  11 +-
 .../projects/RoyaleUnit/src/test/royale/build.xml  |  37 +--
 .../language/LanguageTesterTestVector.as           |  61 ++++
 .../flexUnitTests/xml/XMLTesterGeneralTest.as      |   2 +-
 71 files changed, 1752 insertions(+), 1723 deletions(-)
 copy examples/blog/{BE0010_Customization_through_the_Royale_API/BE0010_Customization_through_the_Royale_API.as3proj => BE0012_Using_external_javascript_libraries_in_Apache_Royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.as3proj} (94%)
 copy examples/blog/{BE0011_Loading_external_data_through_HTTPService => BE0012_Using_external_javascript_libraries_in_Apache_Royale}/README.txt (100%)
 copy examples/blog/{BE0005_Creating_a_group_of_Jewel_RadioButtons => BE0012_Using_external_javascript_libraries_in_Apache_Royale}/asconfig.json (94%)
 copy examples/blog/{BE0002_Using_Jewel_Alert_Control => BE0012_Using_external_javascript_libraries_in_Apache_Royale}/build.xml (96%)
 copy examples/blog/{BE0011_Loading_external_data_through_HTTPService => BE0012_Using_external_javascript_libraries_in_Apache_Royale}/pom.xml (91%)
 copy examples/blog/{BE0011_Loading_external_data_through_HTTPService => BE0012_Using_external_javascript_libraries_in_Apache_Royale}/src/main/resources/jewel-example-index-template.html (100%)
 create mode 100644 examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
 copy examples/{royale/TourDeJewel => blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale}/src/main/royale/hljs.as (100%)
 copy examples/{mxroyale/SparkHelloWorld/SparkHelloWorld.as3proj => royale/ASDoc/ASDoc.as3proj} (85%)
 delete mode 100644 frameworks/ace-config.xml
 copy frameworks/{projects/Core => js/projects/BasicJS}/src/test/royale/build.xml (60%)
 copy frameworks/{projects/Core => js/projects/CoreJS}/src/test/royale/build.xml (60%)
 copy frameworks/{projects/Core => js/projects/RoyaleUnitJS}/src/test/royale/build.xml (60%)
 copy frameworks/projects/{Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers => Basic/src/main/royale/org/apache/royale/html/beads}/CollectionChangeUpdateForArrayListData.as (98%)


Re: [royale-asjs] 05/07: refactor private beads to correspond to different requirements between targets

Posted by Greg Dove <gr...@gmail.com>.
I'd suggest you raise an issue for that if you think it's important. You
can even assign it to me if you want. But I don't personally consider it as
very important.
I can see that it has been there in some form ever since the migration away
from handwritten js classes - approaching 4 years ago, so seems really low
priority imo otherwise I am sure it would have been addressed already by
now. But I am happy to come back to it at some point.

On Thu, May 23, 2019 at 7:44 PM Alex Harui <ah...@adobe.com.invalid> wrote:

> Ideally, there wouldn't be an HTMLElementWrapper at all on the SWF side
> since there is no HTMLElement to wrap.
>
> I would rather we find a way to get rid of HTMLElementWrapper on the SWF
> side in order to prove that we don't need the same set of base classes on
> each platform.  In fact, there might be a way to put the "override" in a
> "COMPILE::JS" block in UIBase.
>
> My 2 cents,
> -Alex
>
> On 5/23/19, 12:05 AM, "gregdove@apache.org" <gr...@apache.org> wrote:
>
>     This is an automated email from the ASF dual-hosted git repository.
>
>     gregdove pushed a commit to branch improvements/Language
>     in repository
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7Cfab4455dfe08412f9edd08d6df4d0f98%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636941919434601918&amp;sdata=Vn82YDCwic7rTP%2BXXAq8IxK9%2Fi%2FGAmEuldRkVLr0gXs%3D&amp;reserved=0
>
>     commit bce6ba5a778372f10f60ba4f7af872da56740a39
>     Author: greg-dove <gr...@gmail.com>
>     AuthorDate: Thu May 23 18:30:06 2019 +1200
>
>         refactor private beads to correspond to different requirements
> between targets
>     ---
>      .../main/royale/org/apache/royale/core/UIBase.as   |  99
> ++----------------
>      .../org/apache/royale/core/HTMLElementWrapper.as   | 112
> +++++++++++++++++++--
>      2 files changed, 109 insertions(+), 102 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 613c940..a9f9f52 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
>     @@ -904,43 +904,6 @@ package org.apache.royale.core
>              {
>                  return element.childNodes as Array;
>              }
>     -
>     -        COMPILE::SWF
>     -           private var _model:IBeadModel;
>     -
>     -        /**
>     -         *  An IBeadModel that serves as the data model for the
> component.
>     -         *
>     -         *  @langversion 3.0
>     -         *  @playerversion Flash 10.2
>     -         *  @playerversion AIR 2.6
>     -         *  @productversion Royale 0.0
>     -         */
>     -        COMPILE::SWF
>     -        public function get model():Object
>     -           {
>     -            if (_model == null)
>     -            {
>     -                // addbead will set _model
>     -                addBead(new (ValuesManager.valuesImpl.getValue(this,
> "iBeadModel")) as IBead);
>     -            }
>     -                   return _model;
>     -           }
>     -
>     -        COMPILE::SWF
>     -        /**
>     -         * @private
>     -         * @royaleignorecoercion org.apache.royale.core.IBead
>     -         */
>     -        [Bindable("modelChanged")]
>     -           public function set model(value:Object):void
>     -           {
>     -                   if (_model != value)
>     -                   {
>     -                           addBead(value as IBead);
>     -                           dispatchEvent(new Event("modelChanged"));
>     -                   }
>     -           }
>
>              private var _view:IBeadView;
>
>     @@ -1157,8 +1120,6 @@ package org.apache.royale.core
>               */
>                 public var beads:Array;
>
>     -        COMPILE::SWF
>     -           private var _beads:Vector.<IBead>;
>
>              /**
>               *  @copy org.apache.royale.core.IStrand#addBead()
>     @@ -1173,17 +1134,12 @@ package org.apache.royale.core
>                 override public function addBead(bead:IBead):void
>                 {
>                  var isView:Boolean;
>     -                   if (!_beads)
>     -                           _beads = new Vector.<IBead>;
>     -                   _beads.push(bead);
>     -                   if (bead is IBeadModel)
>     -                           _model = bead as IBeadModel;
>     -            else if (bead is IBeadView)
>     -            {
>     -                _view = bead as IBeadView;
>     -                isView = true
>     -            }
>     -                   bead.strand = this;
>     +
>     +                   super.addBead(bead);
>     +                   if (this._model !== bead && bead is IBeadView) {
>     +                           _view = bead as IBeadView;
>     +                           isView = true
>     +                   }
>
>                         if (isView) {
>                                 dispatchEvent(new Event("viewChanged"));
>     @@ -1191,49 +1147,6 @@ package org.apache.royale.core
>                 }
>
>              /**
>     -         *  @copy org.apache.royale.core.IStrand#getBeadByType()
>     -         *
>     -         *  @langversion 3.0
>     -         *  @playerversion Flash 10.2
>     -         *  @playerversion AIR 2.6
>     -         *  @productversion Royale 0.0
>     -         */
>     -        COMPILE::SWF
>     -           public function getBeadByType(classOrInterface:Class):IBead
>     -           {
>     -                   for each (var bead:IBead in _beads)
>     -                   {
>     -                           if (bead is classOrInterface)
>     -                                   return bead;
>     -                   }
>     -                   return null;
>     -           }
>     -
>     -        /**
>     -         *  @copy org.apache.royale.core.IStrand#removeBead()
>     -         *
>     -         *  @langversion 3.0
>     -         *  @playerversion Flash 10.2
>     -         *  @playerversion AIR 2.6
>     -         *  @productversion Royale 0.0
>     -         */
>     -        COMPILE::SWF
>     -           public function removeBead(value:IBead):IBead
>     -           {
>     -                   var n:int = _beads.length;
>     -                   for (var i:int = 0; i < n; i++)
>     -                   {
>     -                           var bead:IBead = _beads[i];
>     -                           if (bead == value)
>     -                           {
>     -                                   _beads.splice(i, 1);
>     -                                   return bead;
>     -                           }
>     -                   }
>     -                   return null;
>     -           }
>     -
>     -        /**
>               *  @copy org.apache.royale.core.IParent#addElement()
>               *
>               *  @langversion 3.0
>     diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
>     index 4ebff5a..85e5597 100644
>     ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
>     +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
>     @@ -23,6 +23,7 @@ package org.apache.royale.core
>          COMPILE::SWF
>          {
>              import flash.display.Sprite;
>     +        import org.apache.royale.events.Event;
>          }
>
>          COMPILE::JS
>     @@ -35,18 +36,110 @@ package org.apache.royale.core
>              import goog.events;
>              import goog.events.BrowserEvent;
>              import goog.events.EventTarget;
>     +        import goog.DEBUG;
>              import org.apache.royale.events.utils.EventUtils;
>          }
>
>          COMPILE::SWF
>     -    public class HTMLElementWrapper extends Sprite
>     +    public class HTMLElementWrapper extends Sprite implements
> IStrand, IEventDispatcher
>          {
>     +
>     +        private var _beads:Vector.<IBead>;
>     +
>              /**
>     -         * "abstract" method so we can override in JS
>               * @param bead The new bead.
>               */
>              public function addBead(bead:IBead):void
>     -        {
>     +        {
>     +            if (!_beads)
>     +            {
>     +                _beads = new Vector.<IBead>();
>     +            }
>     +            _beads.push(bead);
>     +
>     +            if (bead is IBeadModel)
>     +            {
>     +                _model = bead as IBeadModel;
>     +            }
>     +
>     +            bead.strand = this;
>     +        }
>     +
>     +        /**
>     +         *  @copy org.apache.royale.core.IStrand#getBeadByType()
>     +         *
>     +         *  @langversion 3.0
>     +         *  @playerversion Flash 10.2
>     +         *  @playerversion AIR 2.6
>     +         *  @productversion Royale 0.0
>     +         */
>     +        public function getBeadByType(classOrInterface:Class):IBead
>     +        {
>     +            for each (var bead:IBead in _beads)
>     +            {
>     +                if (bead is classOrInterface)
>     +                    return bead;
>     +            }
>     +            return null;
>     +        }
>     +
>     +
>     +        /**
>     +         *  @copy org.apache.royale.core.IStrand#removeBead()
>     +         *
>     +         *  @langversion 3.0
>     +         *  @playerversion Flash 10.2
>     +         *  @playerversion AIR 2.6
>     +         *  @productversion Royale 0.0
>     +         */
>     +        public function removeBead(value:IBead):IBead
>     +        {
>     +            var n:int = _beads.length;
>     +            for (var i:int = 0; i < n; i++)
>     +            {
>     +                var bead:IBead = _beads[i];
>     +                if (bead == value)
>     +                {
>     +                    _beads.splice(i, 1);
>     +                    return bead;
>     +                }
>     +            }
>     +            return null;
>     +        }
>     +
>     +
>     +
>     +        /**
>     +         * allow access from overrides
>     +         */
>     +        protected var _model:IBeadModel;
>     +
>     +        /**
>     +         * @royaleignorecoercion Class
>     +         * @royaleignorecoercion org.apache.royale.core.IBeadModel
>     +         */
>     +        public function get model():Object
>     +        {
>     +            if (_model == null)
>     +            {
>     +                // addbead will set _model
>     +                addBead(new (ValuesManager.valuesImpl.getValue(this,
> "iBeadModel")) as IBead);
>     +            }
>     +            return _model;
>     +        }
>     +
>     +        /**
>     +         * @private
>     +         * @royaleignorecoercion org.apache.royale.core.IBead
>     +         */
>     +        [Bindable("modelChanged")]
>     +        public function set model(value:Object):void
>     +        {
>     +            if (_model != value)
>     +            {
>     +                addBead(value as IBead);
>     +                dispatchEvent(new Event("modelChanged"));
>     +            }
>              }
>          }
>
>     @@ -132,7 +225,7 @@ package org.apache.royale.core
>              /**
>               * allow access from overrides
>               */
>     -           protected var _model:Object;
>     +           protected var _model:IBeadModel;
>
>              /**
>               * @royaleignorecoercion Class
>     @@ -153,6 +246,7 @@ package org.apache.royale.core
>
>              /**
>               * @royaleignorecoercion org.apache.royale.core.IBead
>     +         * @royaleignorecoercion org.apache.royale.core.IBeadModel
>               */
>              [Bindable("modelChanged")]
>              public function set model(value:Object):void
>     @@ -162,12 +256,12 @@ package org.apache.royale.core
>                      if (value is IBead)
>                          addBead(value as IBead);
>                      else
>     -                    _model = value;
>     +                    _model = IBeadModel(value);
>                      dispatchEvent(new
> org.apache.royale.events.Event("modelChanged"));
>                  }
>              }
>     -
>     -           protected var _beads:Vector.<IBead>;
>     +
>     +           private var _beads:Array;
>
>                 //--------------------------------------
>                 //   Function
>     @@ -181,9 +275,9 @@ package org.apache.royale.core
>                 {
>                         if (!_beads)
>                         {
>     -                           _beads = new Vector.<IBead>();
>     +                           _beads = [];
>                         }
>     -
>     +            if (goog.DEBUG && !(bead is IBead)) throw new
> TypeError('Cannot convert '+bead+' to IBead')
>                         _beads.push(bead);
>
>                         if (bead is IBeadModel)
>
>
>
>

Re: [royale-asjs] 05/07: refactor private beads to correspond to different requirements between targets

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Ideally, there wouldn't be an HTMLElementWrapper at all on the SWF side since there is no HTMLElement to wrap.

I would rather we find a way to get rid of HTMLElementWrapper on the SWF side in order to prove that we don't need the same set of base classes on each platform.  In fact, there might be a way to put the "override" in a "COMPILE::JS" block in UIBase.

My 2 cents,
-Alex

On 5/23/19, 12:05 AM, "gregdove@apache.org" <gr...@apache.org> wrote:

    This is an automated email from the ASF dual-hosted git repository.
    
    gregdove pushed a commit to branch improvements/Language
    in repository https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7Cfab4455dfe08412f9edd08d6df4d0f98%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636941919434601918&amp;sdata=Vn82YDCwic7rTP%2BXXAq8IxK9%2Fi%2FGAmEuldRkVLr0gXs%3D&amp;reserved=0
    
    commit bce6ba5a778372f10f60ba4f7af872da56740a39
    Author: greg-dove <gr...@gmail.com>
    AuthorDate: Thu May 23 18:30:06 2019 +1200
    
        refactor private beads to correspond to different requirements between targets
    ---
     .../main/royale/org/apache/royale/core/UIBase.as   |  99 ++----------------
     .../org/apache/royale/core/HTMLElementWrapper.as   | 112 +++++++++++++++++++--
     2 files changed, 109 insertions(+), 102 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 613c940..a9f9f52 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
    @@ -904,43 +904,6 @@ package org.apache.royale.core
             {
                 return element.childNodes as Array;
             }
    -        
    -        COMPILE::SWF
    -		private var _model:IBeadModel;
    -
    -        /**
    -         *  An IBeadModel that serves as the data model for the component.
    -         *  
    -         *  @langversion 3.0
    -         *  @playerversion Flash 10.2
    -         *  @playerversion AIR 2.6
    -         *  @productversion Royale 0.0
    -         */
    -        COMPILE::SWF
    -        public function get model():Object
    -		{
    -            if (_model == null)
    -            {
    -                // addbead will set _model
    -                addBead(new (ValuesManager.valuesImpl.getValue(this, "iBeadModel")) as IBead);
    -            }
    -			return _model;
    -		}
    -
    -        COMPILE::SWF
    -        /**
    -         * @private
    -         * @royaleignorecoercion org.apache.royale.core.IBead
    -         */
    -        [Bindable("modelChanged")]
    -		public function set model(value:Object):void
    -		{
    -			if (_model != value)
    -			{
    -				addBead(value as IBead);
    -				dispatchEvent(new Event("modelChanged"));
    -			}
    -		}
     		
             private var _view:IBeadView;
             
    @@ -1157,8 +1120,6 @@ package org.apache.royale.core
              */
     		public var beads:Array;
     		
    -        COMPILE::SWF
    -		private var _beads:Vector.<IBead>;
             
             /**
              *  @copy org.apache.royale.core.IStrand#addBead()
    @@ -1173,17 +1134,12 @@ package org.apache.royale.core
     		override public function addBead(bead:IBead):void
     		{
                 var isView:Boolean;
    -			if (!_beads)
    -				_beads = new Vector.<IBead>;
    -			_beads.push(bead);
    -			if (bead is IBeadModel)
    -				_model = bead as IBeadModel;
    -            else if (bead is IBeadView)
    -            {
    -                _view = bead as IBeadView;
    -                isView = true
    -            }
    -			bead.strand = this;
    +			
    +			super.addBead(bead);
    +			if (this._model !== bead && bead is IBeadView) {
    +				_view = bead as IBeadView;
    +				isView = true
    +			}
     			
     			if (isView) {
     				dispatchEvent(new Event("viewChanged"));
    @@ -1191,49 +1147,6 @@ package org.apache.royale.core
     		}
     		
             /**
    -         *  @copy org.apache.royale.core.IStrand#getBeadByType()
    -         *  
    -         *  @langversion 3.0
    -         *  @playerversion Flash 10.2
    -         *  @playerversion AIR 2.6
    -         *  @productversion Royale 0.0
    -         */
    -        COMPILE::SWF
    -		public function getBeadByType(classOrInterface:Class):IBead
    -		{
    -			for each (var bead:IBead in _beads)
    -			{
    -				if (bead is classOrInterface)
    -					return bead;
    -			}
    -			return null;
    -		}
    -		
    -        /**
    -         *  @copy org.apache.royale.core.IStrand#removeBead()
    -         *  
    -         *  @langversion 3.0
    -         *  @playerversion Flash 10.2
    -         *  @playerversion AIR 2.6
    -         *  @productversion Royale 0.0
    -         */
    -        COMPILE::SWF
    -		public function removeBead(value:IBead):IBead	
    -		{
    -			var n:int = _beads.length;
    -			for (var i:int = 0; i < n; i++)
    -			{
    -				var bead:IBead = _beads[i];
    -				if (bead == value)
    -				{
    -					_beads.splice(i, 1);
    -					return bead;
    -				}
    -			}
    -			return null;
    -		}
    -		
    -        /**
              *  @copy org.apache.royale.core.IParent#addElement()
              * 
              *  @langversion 3.0
    diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
    index 4ebff5a..85e5597 100644
    --- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
    +++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
    @@ -23,6 +23,7 @@ package org.apache.royale.core
         COMPILE::SWF
         {
             import flash.display.Sprite;
    +        import org.apache.royale.events.Event;
         }
             
         COMPILE::JS
    @@ -35,18 +36,110 @@ package org.apache.royale.core
             import goog.events;
             import goog.events.BrowserEvent;
             import goog.events.EventTarget;
    +        import goog.DEBUG;
             import org.apache.royale.events.utils.EventUtils;
         }
     
         COMPILE::SWF
    -    public class HTMLElementWrapper extends Sprite
    +    public class HTMLElementWrapper extends Sprite implements IStrand, IEventDispatcher
         {
    +        
    +        private var _beads:Vector.<IBead>;
    +    
             /**
    -         * "abstract" method so we can override in JS
              * @param bead The new bead.
              */
             public function addBead(bead:IBead):void
    -        {            
    +        {
    +            if (!_beads)
    +            {
    +                _beads = new Vector.<IBead>();
    +            }
    +            _beads.push(bead);
    +        
    +            if (bead is IBeadModel)
    +            {
    +                _model = bead as IBeadModel;
    +            }
    +        
    +            bead.strand = this;
    +        }
    +    
    +        /**
    +         *  @copy org.apache.royale.core.IStrand#getBeadByType()
    +         *
    +         *  @langversion 3.0
    +         *  @playerversion Flash 10.2
    +         *  @playerversion AIR 2.6
    +         *  @productversion Royale 0.0
    +         */
    +        public function getBeadByType(classOrInterface:Class):IBead
    +        {
    +            for each (var bead:IBead in _beads)
    +            {
    +                if (bead is classOrInterface)
    +                    return bead;
    +            }
    +            return null;
    +        }
    +    
    +    
    +        /**
    +         *  @copy org.apache.royale.core.IStrand#removeBead()
    +         *
    +         *  @langversion 3.0
    +         *  @playerversion Flash 10.2
    +         *  @playerversion AIR 2.6
    +         *  @productversion Royale 0.0
    +         */
    +        public function removeBead(value:IBead):IBead
    +        {
    +            var n:int = _beads.length;
    +            for (var i:int = 0; i < n; i++)
    +            {
    +                var bead:IBead = _beads[i];
    +                if (bead == value)
    +                {
    +                    _beads.splice(i, 1);
    +                    return bead;
    +                }
    +            }
    +            return null;
    +        }
    +    
    +    
    +    
    +        /**
    +         * allow access from overrides
    +         */
    +        protected var _model:IBeadModel;
    +    
    +        /**
    +         * @royaleignorecoercion Class
    +         * @royaleignorecoercion org.apache.royale.core.IBeadModel
    +         */
    +        public function get model():Object
    +        {
    +            if (_model == null)
    +            {
    +                // addbead will set _model
    +                addBead(new (ValuesManager.valuesImpl.getValue(this, "iBeadModel")) as IBead);
    +            }
    +            return _model;
    +        }
    +    
    +        /**
    +         * @private
    +         * @royaleignorecoercion org.apache.royale.core.IBead
    +         */
    +        [Bindable("modelChanged")]
    +        public function set model(value:Object):void
    +        {
    +            if (_model != value)
    +            {
    +                addBead(value as IBead);
    +                dispatchEvent(new Event("modelChanged"));
    +            }
             }
         }
         
    @@ -132,7 +225,7 @@ package org.apache.royale.core
             /**
              * allow access from overrides
              */
    -		protected var _model:Object;
    +		protected var _model:IBeadModel;
             
             /**
              * @royaleignorecoercion Class 
    @@ -153,6 +246,7 @@ package org.apache.royale.core
             
             /**
              * @royaleignorecoercion org.apache.royale.core.IBead
    +         * @royaleignorecoercion org.apache.royale.core.IBeadModel
              */
             [Bindable("modelChanged")]
             public function set model(value:Object):void
    @@ -162,12 +256,12 @@ package org.apache.royale.core
                     if (value is IBead)
                         addBead(value as IBead);
                     else
    -                    _model = value;
    +                    _model = IBeadModel(value);
                     dispatchEvent(new org.apache.royale.events.Event("modelChanged"));
                 }
             }
    -
    -		protected var _beads:Vector.<IBead>;
    +        
    +		private var _beads:Array;
             
     		//--------------------------------------
     		//   Function
    @@ -181,9 +275,9 @@ package org.apache.royale.core
     		{
     			if (!_beads)
     			{
    -				_beads = new Vector.<IBead>();
    +				_beads = [];
     			}
    -
    +            if (goog.DEBUG && !(bead is IBead)) throw new TypeError('Cannot convert '+bead+' to IBead')
     			_beads.push(bead);
     
     			if (bead is IBeadModel)
    
    


[royale-asjs] 05/07: refactor private beads to correspond to different requirements between targets

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bce6ba5a778372f10f60ba4f7af872da56740a39
Author: greg-dove <gr...@gmail.com>
AuthorDate: Thu May 23 18:30:06 2019 +1200

    refactor private beads to correspond to different requirements between targets
---
 .../main/royale/org/apache/royale/core/UIBase.as   |  99 ++----------------
 .../org/apache/royale/core/HTMLElementWrapper.as   | 112 +++++++++++++++++++--
 2 files changed, 109 insertions(+), 102 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 613c940..a9f9f52 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
@@ -904,43 +904,6 @@ package org.apache.royale.core
         {
             return element.childNodes as Array;
         }
-        
-        COMPILE::SWF
-		private var _model:IBeadModel;
-
-        /**
-         *  An IBeadModel that serves as the data model for the component.
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.0
-         */
-        COMPILE::SWF
-        public function get model():Object
-		{
-            if (_model == null)
-            {
-                // addbead will set _model
-                addBead(new (ValuesManager.valuesImpl.getValue(this, "iBeadModel")) as IBead);
-            }
-			return _model;
-		}
-
-        COMPILE::SWF
-        /**
-         * @private
-         * @royaleignorecoercion org.apache.royale.core.IBead
-         */
-        [Bindable("modelChanged")]
-		public function set model(value:Object):void
-		{
-			if (_model != value)
-			{
-				addBead(value as IBead);
-				dispatchEvent(new Event("modelChanged"));
-			}
-		}
 		
         private var _view:IBeadView;
         
@@ -1157,8 +1120,6 @@ package org.apache.royale.core
          */
 		public var beads:Array;
 		
-        COMPILE::SWF
-		private var _beads:Vector.<IBead>;
         
         /**
          *  @copy org.apache.royale.core.IStrand#addBead()
@@ -1173,17 +1134,12 @@ package org.apache.royale.core
 		override public function addBead(bead:IBead):void
 		{
             var isView:Boolean;
-			if (!_beads)
-				_beads = new Vector.<IBead>;
-			_beads.push(bead);
-			if (bead is IBeadModel)
-				_model = bead as IBeadModel;
-            else if (bead is IBeadView)
-            {
-                _view = bead as IBeadView;
-                isView = true
-            }
-			bead.strand = this;
+			
+			super.addBead(bead);
+			if (this._model !== bead && bead is IBeadView) {
+				_view = bead as IBeadView;
+				isView = true
+			}
 			
 			if (isView) {
 				dispatchEvent(new Event("viewChanged"));
@@ -1191,49 +1147,6 @@ package org.apache.royale.core
 		}
 		
         /**
-         *  @copy org.apache.royale.core.IStrand#getBeadByType()
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.0
-         */
-        COMPILE::SWF
-		public function getBeadByType(classOrInterface:Class):IBead
-		{
-			for each (var bead:IBead in _beads)
-			{
-				if (bead is classOrInterface)
-					return bead;
-			}
-			return null;
-		}
-		
-        /**
-         *  @copy org.apache.royale.core.IStrand#removeBead()
-         *  
-         *  @langversion 3.0
-         *  @playerversion Flash 10.2
-         *  @playerversion AIR 2.6
-         *  @productversion Royale 0.0
-         */
-        COMPILE::SWF
-		public function removeBead(value:IBead):IBead	
-		{
-			var n:int = _beads.length;
-			for (var i:int = 0; i < n; i++)
-			{
-				var bead:IBead = _beads[i];
-				if (bead == value)
-				{
-					_beads.splice(i, 1);
-					return bead;
-				}
-			}
-			return null;
-		}
-		
-        /**
          *  @copy org.apache.royale.core.IParent#addElement()
          * 
          *  @langversion 3.0
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
index 4ebff5a..85e5597 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
@@ -23,6 +23,7 @@ package org.apache.royale.core
     COMPILE::SWF
     {
         import flash.display.Sprite;
+        import org.apache.royale.events.Event;
     }
         
     COMPILE::JS
@@ -35,18 +36,110 @@ package org.apache.royale.core
         import goog.events;
         import goog.events.BrowserEvent;
         import goog.events.EventTarget;
+        import goog.DEBUG;
         import org.apache.royale.events.utils.EventUtils;
     }
 
     COMPILE::SWF
-    public class HTMLElementWrapper extends Sprite
+    public class HTMLElementWrapper extends Sprite implements IStrand, IEventDispatcher
     {
+        
+        private var _beads:Vector.<IBead>;
+    
         /**
-         * "abstract" method so we can override in JS
          * @param bead The new bead.
          */
         public function addBead(bead:IBead):void
-        {            
+        {
+            if (!_beads)
+            {
+                _beads = new Vector.<IBead>();
+            }
+            _beads.push(bead);
+        
+            if (bead is IBeadModel)
+            {
+                _model = bead as IBeadModel;
+            }
+        
+            bead.strand = this;
+        }
+    
+        /**
+         *  @copy org.apache.royale.core.IStrand#getBeadByType()
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+        public function getBeadByType(classOrInterface:Class):IBead
+        {
+            for each (var bead:IBead in _beads)
+            {
+                if (bead is classOrInterface)
+                    return bead;
+            }
+            return null;
+        }
+    
+    
+        /**
+         *  @copy org.apache.royale.core.IStrand#removeBead()
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion Royale 0.0
+         */
+        public function removeBead(value:IBead):IBead
+        {
+            var n:int = _beads.length;
+            for (var i:int = 0; i < n; i++)
+            {
+                var bead:IBead = _beads[i];
+                if (bead == value)
+                {
+                    _beads.splice(i, 1);
+                    return bead;
+                }
+            }
+            return null;
+        }
+    
+    
+    
+        /**
+         * allow access from overrides
+         */
+        protected var _model:IBeadModel;
+    
+        /**
+         * @royaleignorecoercion Class
+         * @royaleignorecoercion org.apache.royale.core.IBeadModel
+         */
+        public function get model():Object
+        {
+            if (_model == null)
+            {
+                // addbead will set _model
+                addBead(new (ValuesManager.valuesImpl.getValue(this, "iBeadModel")) as IBead);
+            }
+            return _model;
+        }
+    
+        /**
+         * @private
+         * @royaleignorecoercion org.apache.royale.core.IBead
+         */
+        [Bindable("modelChanged")]
+        public function set model(value:Object):void
+        {
+            if (_model != value)
+            {
+                addBead(value as IBead);
+                dispatchEvent(new Event("modelChanged"));
+            }
         }
     }
     
@@ -132,7 +225,7 @@ package org.apache.royale.core
         /**
          * allow access from overrides
          */
-		protected var _model:Object;
+		protected var _model:IBeadModel;
         
         /**
          * @royaleignorecoercion Class 
@@ -153,6 +246,7 @@ package org.apache.royale.core
         
         /**
          * @royaleignorecoercion org.apache.royale.core.IBead
+         * @royaleignorecoercion org.apache.royale.core.IBeadModel
          */
         [Bindable("modelChanged")]
         public function set model(value:Object):void
@@ -162,12 +256,12 @@ package org.apache.royale.core
                 if (value is IBead)
                     addBead(value as IBead);
                 else
-                    _model = value;
+                    _model = IBeadModel(value);
                 dispatchEvent(new org.apache.royale.events.Event("modelChanged"));
             }
         }
-
-		protected var _beads:Vector.<IBead>;
+        
+		private var _beads:Array;
         
 		//--------------------------------------
 		//   Function
@@ -181,9 +275,9 @@ package org.apache.royale.core
 		{
 			if (!_beads)
 			{
-				_beads = new Vector.<IBead>();
+				_beads = [];
 			}
-
+            if (goog.DEBUG && !(bead is IBead)) throw new TypeError('Cannot convert '+bead+' to IBead')
 			_beads.push(bead);
 
 			if (bead is IBeadModel)


[royale-asjs] 04/07: Vector improvements and optimizations (runtime performance, output footprint)

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit beac5c6040697c971ab371d5018fe13c59ec1895
Author: greg-dove <gr...@gmail.com>
AuthorDate: Thu May 23 18:22:36 2019 +1200

    Vector improvements and optimizations (runtime performance, output footprint)
---
 .../royale/org/apache/royale/utils/Language.as     | 298 ++++++++++++++-------
 .../language/LanguageTesterTestVector.as           |  61 +++++
 .../flexUnitTests/xml/XMLTesterGeneralTest.as      |   2 +-
 3 files changed, 263 insertions(+), 98 deletions(-)

diff --git a/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as b/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as
index f21cfce..796cdc6 100644
--- a/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as
+++ b/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as
@@ -36,6 +36,7 @@ package org.apache.royale.utils
     /**
      * @royaleignoreimport goog.bind
      * @royaleignoreimport goog.global
+     * @royalesuppressexport
      */
     COMPILE::JS
     public class Language
@@ -88,8 +89,8 @@ package org.apache.royale.utils
                 if (leftOperand == null) {
                     return null;
                 }
-                const leftType:String = leftOperand.ROYALE_CLASS_INFO ? leftOperand.ROYALE_CLASS_INFO.names[0].qName : String(leftOperand);
-                const rightType:String = rightOperand.prototype && rightOperand.prototype.ROYALE_CLASS_INFO ? rightOperand.prototype.ROYALE_CLASS_INFO.names[0].qName: String(rightOperand);
+                const leftType:String = '' + (leftOperand.ROYALE_CLASS_INFO ? leftOperand.ROYALE_CLASS_INFO.names[0].qName : String(leftOperand));
+                const rightType:String = '' + (rightOperand.prototype && rightOperand.prototype.ROYALE_CLASS_INFO ? rightOperand.prototype.ROYALE_CLASS_INFO.names[0].qName: String(rightOperand));
                 throw new TypeError('Error #1034: Type Coercion failed: cannot convert ' + leftType + ' to ' + rightType);
             }
             
@@ -225,9 +226,9 @@ package org.apache.royale.utils
             return false;
         }
         
-        /**
+        /*/!**
          * Implementation of "classDef is Class"
-         */
+         *!/
         public function isClass(classDef:*):Boolean
         {
             return typeof classDef === 'function'
@@ -235,13 +236,13 @@ package org.apache.royale.utils
                     && classDef.prototype.constructor === classDef;
         }
         
-        /**
+        /!**
          * Implementation of "classDef as Class"
-         */
+         *!/
         public function asClass(classDef:*):Class
         {
             return isClass(classDef) ? classDef : null;
-        }
+        }*/
         
         /**
          * @royaledebug
@@ -458,7 +459,12 @@ package org.apache.royale.utils
             }
             return 0;
         }
-        
+    
+    
+        /**
+         * no export (allow dead code elimination):
+         * @royalesuppressexport
+         */
         public static function resolveUncertain(val:*):*
         {
             if (val) {
@@ -469,12 +475,20 @@ package org.apache.royale.utils
         }
         
         private static var _synthType:Class;
+        /**
+         * @royalesuppressexport
+         */
         public static const SYNTH_TAG_FIELD:String = goog.DEBUG ? '_synthType' : '_s';
+        /**
+         * @royalesuppressexport
+         */
         public static const CHECK_INDEX:String = goog.DEBUG ? 'chkIdx' : '_ci';
     
         /**
          *
          * @royalesuppressresolveuncertain true, _synthType
+         * no export (allow dead code elimination):
+         * @royalesuppressexport
          */
         public static function synthType(typeName:String, newDefinition:*):Class
         {
@@ -525,6 +539,8 @@ package org.apache.royale.utils
     
         /**
          * @royaleignorecoercion Array
+         * no export (allow dead code elimination):
+         * @royalesuppressexport
          */
         public static function synthVector(elementType:String):Class
         {
@@ -543,7 +559,7 @@ package org.apache.royale.utils
                         instance = a[--l];
                         fixed = l == 2 ? a[--l] : false;
                         size = l == 1 ? a[0] : 0;
-                        instance[VectorSupport.ELEMENT_TYPE] = elementType;
+                        //instance[VectorSupport.ELEMENT_TYPE] = elementType;
                         instance['type'] = typeName;
                         instance[VectorSupport.FIXED_LEN] = fixed ? size : -1;
                         return VectorSupport.arrayVector([], size, elementType, fixed, instance);
@@ -565,7 +581,7 @@ package org.apache.royale.utils
                     },
                     'noWrap': true
                 });
-                VectorSupport.vectorElementCoercion(elementType, type);
+                VectorSupport.vectorElementCoercion(elementType, type, false);
                 VectorSupport.vectorElementDefault(elementType, type);
                 type.prototype = Object.create(type.prototype);
                 const baseVectorOverrides:Object = VectorSupport.getBaseOverrides();
@@ -585,7 +601,9 @@ package org.apache.royale.utils
                     'constructor': { value:type }
                 };
                 localOverrides[Language.CHECK_INDEX] = {value:baseVectorOverrides[Language.CHECK_INDEX]};
-                localOverrides[VectorSupport.COERCE_ELEMENT] = { value: type[VectorSupport.COERCE_ELEMENT] };
+                localOverrides[VectorSupport.ELEMENT_TYPE] = { value: elementType };
+                localOverrides['type'] = { value: typeName };
+                localOverrides[VectorSupport.COERCE_ELEMENT] = { value: type[VectorSupport.COERCE_ELEMENT], configurable: true};
                 localOverrides[VectorSupport.DEFAULT_VALUE] = {  value: type[VectorSupport.DEFAULT_VALUE] };
                 Object.defineProperties(type.prototype, localOverrides)
 
@@ -600,6 +618,8 @@ package org.apache.royale.utils
          * This could be used to create and return a Vector instance
          *
          * @royaleignorecoercion Array
+         * no export (allow dead code elimination):
+         * @royalesuppressexport
          */
         public static function Vector(size:int = 0, baseType:String = null, fixed:Boolean = false):*
         {
@@ -615,27 +635,51 @@ import goog.DEBUG;
 import goog.global;
 
 COMPILE::JS
+/**
+ * @royalesuppressexport
+ */
 class VectorSupport {
 
     //Warning : code in this class is very dependent on non-generation of closures and possibly other 'quirks'
     //If you make any changes, please verify this against Vector unit tests, across different targets
     
+    /**
+     * @royalesuppressexport
+     */
     public static const fixedRangeError:String = 'Error #1126: Cannot change the length of a fixed Vector';
+    /**
+     * @royalesuppressexport
+     */
     public static const nonConstructorError:String = 'Error #1007: Instantiation attempted on a non-constructor.';
-    
+    /**
+     * @royalesuppressexport
+     */
     public static var langSynthType:Object;
     
+    /**
+     * @royalesuppressexport
+     */
     public static const COERCE_ELEMENT:String = goog.DEBUG ? 'coerceElement' : 'cE';
+    /**
+     * @royalesuppressexport
+     */
     public static const DEFAULT_VALUE:String = goog.DEBUG ? 'defaultValue' : 'dV';
+    /**
+     * @royalesuppressexport
+     */
     public static const ELEMENT_TYPE:String = goog.DEBUG ? 'elementType' : 'eT';
-    
+    /**
+     * @royalesuppressexport
+     */
     public static const FIXED_LEN:String = goog.DEBUG ? 'fixedLen' : 'fL';
     
     private static function indexRangerError(index:Number, limit:uint):String{
         return 'Error #1125: The index ' + index + ' is out of range ' + limit;
     }
     
-    
+    /**
+     * @royalesuppressexport
+     */
     public static function checkIsVector(v:Array, typeName:String):Boolean
     {
         const base:Boolean = v && Language.SYNTH_TAG_FIELD in v;
@@ -647,7 +691,9 @@ class VectorSupport {
         }
         return ret;
     }
-    
+    /**
+     * @royalesuppressexport
+     */   
     public static function vectorElementDefault(elementType:String, synthVectorClass:Object ):Object {
         if (synthVectorClass[VectorSupport.DEFAULT_VALUE] !== undefined) return synthVectorClass[VectorSupport.DEFAULT_VALUE];
         const standardDefaults:Object = {
@@ -667,9 +713,10 @@ class VectorSupport {
     
     /**
      *
-     * @royaleignorecoercion Function
+     * @royaleignorecoercion Function      
+     * @royalesuppressexport
      */
-    public static function vectorElementCoercion(elementType:String, synthVectorClass:Object ):Function{
+    public static function vectorElementCoercion(elementType:String, synthVectorClass:Object, deferred:Boolean):Function{
         if (synthVectorClass[VectorSupport.COERCE_ELEMENT]) return synthVectorClass[VectorSupport.COERCE_ELEMENT] as Function;
         const identity:Function = function(v:*):Object{return v === undefined ? null : v};
         const standardCoercions:Object = {
@@ -686,17 +733,29 @@ class VectorSupport {
             if (elementType.indexOf('Vector.<') == 0) {
                 coercion = function(v:Object):Object{ if (!(v === null || Language.synthVector(elementType.slice(8,-1))['checkIs'](v))) {throw new TypeError('Error #1034: Type Coercion failed: cannot convert ' + v + ' to '+ elementType)} else return v  };
             } else {
+                var defer:Boolean = false;
                 var parts:Array = elementType.split('.');
                 var n:int = parts.length;
                 var o:Class = goog.global;
                 for (var i:int = 0; i < n; i++) {
                     o = o && o[parts[i]];
-                    if (!o) throw new TypeError('missing dependency ' + elementType );
+                    if (!o) {
+                        if (deferred) throw new TypeError('missing dependency ' + elementType );
+                        defer = true;
+                        break;
+                    }
                 }
-                coercion = function(v:Object):Object{ return Language.as(v,o,true)};
+                if (defer) {
+                    coercion = null;
+                }
+                else coercion = function(v:Object):Object{ return Language.as(v,o,true)};
             }
         }
         synthVectorClass[VectorSupport.COERCE_ELEMENT] = coercion;
+        if (deferred) {
+            //patch the prototype
+            Object.defineProperty(synthVectorClass.prototype, VectorSupport.COERCE_ELEMENT, {value: coercion})
+        }
         return coercion;
     }
     
@@ -704,7 +763,10 @@ class VectorSupport {
      * @royaleignorecoercion Function
      */
     private static function coerceElements(arr:Array, size:uint, tag:Object):Error{
-        const coercion:Function = tag[COERCE_ELEMENT] as Function;
+        var coercion:Function = tag[COERCE_ELEMENT] as Function;
+        if (coercion == null) {
+            coercion = VectorSupport.vectorElementCoercion(tag[ELEMENT_TYPE], tag.constructor, true);
+        }
         var err:Error;
         for (var i:int = 0; i < size; i++)
         {
@@ -726,13 +788,16 @@ class VectorSupport {
     
     /**
      * @royaleignorecoercion Function
+     * @royalesuppressexport
      */
-    public static function arrayVector(arr:Array, size:int = 0, basetype:String = null, fixed:Boolean = false, tag:Object = null, construct:Boolean = true):Array
+    public static function arrayVector(arr:Array, size:int, basetype:String,fixed:Boolean , tag:Object, construct:Boolean = true):Array
     {
-        if (basetype === null)
+        size = size >>>0;
+        if (basetype == null)
         {
             throw new TypeError(nonConstructorError);
         }
+        
         tagVectorArray(arr, basetype, fixed, tag);
         if (!tag) tag = arr[Language.SYNTH_TAG_FIELD];
         if (size)
@@ -750,7 +815,10 @@ class VectorSupport {
         }
         return arr;
     }
-    
+    /**
+     * @royalesuppressexport
+     * @royalesuppressclosure
+     */    
     public static function tagVectorArray(array:Array, elementType:String, fixed:Boolean, inst:Object):Array
     {
         const vectorType:String ='Vector.<' + elementType + '>';
@@ -763,7 +831,12 @@ class VectorSupport {
         const props:Object = {
             'fixed': {
                 'get' : function():Boolean{return inst[FIXED_LEN] > -1},
-                'set' : function(v:Boolean):void{ inst[FIXED_LEN]= (v ? array.length : -1)}
+                'set' : function(v:Boolean):void{
+                    if (inst[FIXED_LEN] > -1 != v) {
+                        inst[FIXED_LEN]= (v ? array.length : -1);
+                        Object.defineProperties(array,getMutationTypeSafetyOverrides(v));
+                    }
+                }
             },
             'splice': {
                 value: inst.splice
@@ -793,21 +866,7 @@ class VectorSupport {
         props[Language.SYNTH_TAG_FIELD] = {
             value: inst
         };
-        blend(props, getMainTypeSafetyOverrides());
-        //possible future runtime performance tuning based on compilation 'define' setting tweaks
-       /* if (Language.runtimeVectorSafety) {
-            blend(props, getMainTypeSafetyOverrides())
-        } else {
-            blend(props, {
-                'insertAt':{
-                    value: inst.insertAt
-                },
-                'removeAt':{
-                    value: inst.removeAt
-                }
-            })
-        }*/
-        
+        blend(props, getMutationTypeSafetyOverrides(fixed));
         Object.defineProperties (array, props);
         return array;
     }
@@ -816,7 +875,7 @@ class VectorSupport {
     /**
      * Fills the array from a start point (defaults to zero) to its end with the specified value
      */
-    public static function array_fill(arr:Array, value:Object, start:uint):Array{
+    private static function array_fill(arr:Array, value:Object, start:uint):Array{
         if (arr['fill']) {
             return arr['fill'](value, start);
         } else {
@@ -832,68 +891,102 @@ class VectorSupport {
     }
     
     //The instance methods of this class are primarily a source for runtime patching of 'Vector-like' Arrays
-    //The class uses some indirection to avoid the royale compiler generating closures and therefore references to 'this'
+    //The class uses @royalesuppressclosure to avoid the royale compiler generating closures and therefore references to 'this'
     //in the local methods can become references to the Array instance itself in its patched methods
     //with the exception of the get_len and set_len methods where 'this' refers to the instance of the 'synthType' tag
     //attached to the  Array that is considered 'Vector-like'
     
     private static var _instance:VectorSupport;
     private static var _baseObject:Object;
+    /**
+     * @royalesuppressexport
+     * prevent closure generation for the method references:
+     * @royalesuppressclosure
+     */
     public static function getBaseOverrides():Object{
         if (_baseObject) return _baseObject;
         _instance = new VectorSupport();
         _baseObject = {};
-        _baseObject.toString = _instance['toString'];
-        _baseObject.map = _instance['map'];
-        _baseObject.splice = _instance['splice'];
-        _baseObject.slice = _instance['slice'];
-        _baseObject.concat = _instance['concat'];
-        _baseObject.filter = _instance['filter'];
-        _baseObject.uncheckedInsertAt = _instance['uncheckedInsertAt'];
-        _baseObject.uncheckedRemoveAt = _instance['uncheckedRemoveAt'];
-        _baseObject.get_len = _instance['get_len'];
-        _baseObject.set_len = _instance['set_len'];
-        _baseObject[Language.CHECK_INDEX] = _instance['chkIdx'];
+        var inst:VectorSupport = _instance;
+        _baseObject.toString = inst.toString;
+        _baseObject.map = inst.map;
+        _baseObject.splice = inst.splice;
+        _baseObject.slice = inst.slice;
+        _baseObject.concat = inst.concat;
+        _baseObject.filter = inst.filter;
+        _baseObject.uncheckedInsertAt = inst.uncheckedInsertAt;
+        _baseObject.uncheckedRemoveAt = inst.uncheckedRemoveAt;
+        _baseObject.get_len = inst.get_len;
+        _baseObject.set_len = inst.set_len;
+        _baseObject[Language.CHECK_INDEX] = inst.chkIdx;
         return _baseObject;
     }
     
-    private static var _fixedLenObject:Object;
-    public static function getMainTypeSafetyOverrides():Object{
-        if (_fixedLenObject) return _fixedLenObject;
-        _fixedLenObject = {
+    private static var _nonFixedTypeSafetyOverrides:Object;
+    private static var _fixedTypeSafetyOverrides:Object;
+    /**
+     * @royalesuppressexport
+     * @royalesuppressclosure
+     */
+    public static function getMutationTypeSafetyOverrides(fixed:Boolean):Object{
+        if (_nonFixedTypeSafetyOverrides) return fixed ? _fixedTypeSafetyOverrides : _nonFixedTypeSafetyOverrides;
+        var inst:VectorSupport = _instance;
+        _nonFixedTypeSafetyOverrides = {
             'pop': {
-                value:_instance['pop']
+                value:Array.prototype.pop,
+                configurable: true
             },
             'push': {
-                value:_instance['push']
+                value:inst.push,
+                configurable: true
             },
             'shift': {
-                value:_instance['shift']
+                value:Array.prototype.shift,
+                configurable: true
             },
             'unshift': {
-                value:_instance['unshift']
+                value:inst.unshift,
+                configurable: true
             },
             'insertAt': {
-                value:_instance['insertAt']
+                value:inst.insertAt,
+                configurable: true
             },
             'removeAt': {
-                value:_instance['removeAt']
+                value:inst.removeAt,
+                configurable: true
             }
         };
-        return _fixedLenObject;
+        const error:Object = {
+            value:inst.throwRangeError,
+            configurable: true
+        };
+        _fixedTypeSafetyOverrides ={
+            'pop': error,
+            'push': error,
+            'shift': error,
+            'unshift': error,
+            'insertAt': error,
+            'removeAt': error
+        };
+        return fixed ? _fixedTypeSafetyOverrides : _nonFixedTypeSafetyOverrides;
     }
-    
+    /**
+     * @royalesuppressexport
+     */   
     public function  toString():String{
         return Array.prototype.map.call(this, String).toString();
     }
     /**
      * @royaleignorecoercion Array
+     * @royalesuppressexport
      */
     public function map(callback:Function):* {
         var inst:Object= this[Language.SYNTH_TAG_FIELD]; return tagVectorArray(Array.prototype.map.call(this, function(item:Object, index:int, source:*):Object{return inst[COERCE_ELEMENT](callback(item,index,source))}) as Array, inst[ELEMENT_TYPE],false,null);
     }
     /**
      * @royaleignorecoercion Array
+     * @royalesuppressexport
      */
     public function splice():* {
         var a:Array = Array.prototype.slice.call(arguments) as Array;var inst:Object= this[Language.SYNTH_TAG_FIELD]; var ret:Array = Array.prototype.splice.apply(this, a) as Array; if (inst[FIXED_LEN] > -1) inst[FIXED_LEN] = this['length']; return tagVectorArray(ret, inst[ELEMENT_TYPE], false, null);
@@ -901,6 +994,7 @@ class VectorSupport {
     
     /**
      * @royaleignorecoercion Array
+     * @royalesuppressexport
      */
     public function slice():* {
         var a:Array = Array.prototype.slice.call(arguments) as Array;var inst:Object= this[Language.SYNTH_TAG_FIELD]; var ret:Array = Array.prototype.slice.apply(this, a) as Array; return tagVectorArray(ret, inst[ELEMENT_TYPE], false, null);
@@ -908,6 +1002,7 @@ class VectorSupport {
     
     /**
      * @royaleignorecoercion Array
+     * @royalesuppressexport
      */
     public function filter():* {
         var a:Array = Array.prototype.slice.call(arguments) as Array;var inst:Object= this[Language.SYNTH_TAG_FIELD]; var ret:Array = Array.prototype.filter.apply(this, a) as Array; return tagVectorArray(ret, inst[ELEMENT_TYPE], false, null);
@@ -916,6 +1011,7 @@ class VectorSupport {
     /**
      * @royaleignorecoercion Array
      * @royaleignorecoercion String
+     * @royalesuppressexport
      */
     public function concat():* {
         var a:Array = Array.prototype.slice.call(arguments) as Array;var inst:Object = this[Language.SYNTH_TAG_FIELD];
@@ -929,15 +1025,21 @@ class VectorSupport {
         var ret:Array = Array.prototype.concat.apply(this, a) as Array;
         return tagVectorArray(ret,inst[ELEMENT_TYPE], false, null);
     }
-    
+    /**
+     * @royalesuppressexport
+     */
     public function uncheckedInsertAt(index:Number,item:*):* {
         return Array.prototype.splice.call(this, index, 0, item);
     }
-    
+    /**
+     * @royalesuppressexport
+     */
     public function uncheckedRemoveAt(index:Number):* {
         return Array.prototype.splice.call(this, index, 1)[0];
     }
-    
+    /**
+     * @royalesuppressexport
+     */
     public function get_len():Number{
         //'this' inside here is the synthType instance. It has a value property that refers to the
         //Array instance that it 'tags'
@@ -945,6 +1047,7 @@ class VectorSupport {
     }
     /**
      * @royaleignorecoercion Array
+     * @royalesuppressexport
      */
     public function set_len(value:Number):void{
         //'this' here is the synthType instance. It has a value property that refers to the
@@ -961,51 +1064,52 @@ class VectorSupport {
     }
     
     //fixed-length vector-like array overrides
-    public function pop(v:*):* {
-        if (this[Language.SYNTH_TAG_FIELD][FIXED_LEN] > -1) {throw new RangeError(fixedRangeError)} else return Array.prototype.pop.call(this)
-    }
-    
-    public function shift(v:*):* {
-        if (this[Language.SYNTH_TAG_FIELD][FIXED_LEN] > -1) {throw new RangeError(fixedRangeError)} else return Array.prototype.shift.call(this)
-    }
-    
     /**
      * @royaleignorecoercion Array
+     * @royalesuppressexport
      */
     public function push(v:*):* {
-        if (this[Language.SYNTH_TAG_FIELD][FIXED_LEN] > -1) {throw new RangeError(fixedRangeError)} else{
-            var a:Array = Array.prototype.slice.call(arguments) as Array;
-            const err:Error = coerceElements(a, a.length, this[Language.SYNTH_TAG_FIELD]);
-            var len:uint = Array.prototype.push.apply(this,a);
-            if (err) throw new (err.constructor)(err.message);
-            return len;
-        }
+        var a:Array = Array.prototype.slice.call(arguments) as Array;
+        const err:Error = coerceElements(a, a.length, this[Language.SYNTH_TAG_FIELD]);
+        var len:uint = Array.prototype.push.apply(this,a);
+        if (err) throw new (err.constructor)(err.message);
+        return len;
     }
     /**
      * @royaleignorecoercion Array
+     * @royalesuppressexport
      */
     public function unshift(v:*):* {
-        if (this[Language.SYNTH_TAG_FIELD][FIXED_LEN] > -1) {throw new RangeError(fixedRangeError)} else{
-            var a:Array = Array.prototype.slice.call(arguments) as Array;
-            const err:Error = coerceElements(a, a.length, this[Language.SYNTH_TAG_FIELD]);
-            var len:uint = Array.prototype.unshift.apply(this,a);
-            if (err) throw new (err.constructor)(err.message);
-            return len;
-        }
+        var a:Array = Array.prototype.slice.call(arguments) as Array;
+        const err:Error = coerceElements(a, a.length, this[Language.SYNTH_TAG_FIELD]);
+        var len:uint = Array.prototype.unshift.apply(this,a);
+        if (err) throw new (err.constructor)(err.message);
+        return len;
     }
-    
+    /**
+     * @royalesuppressexport
+     */
     public function insertAt(index:int, item:*):void {
-        if (this[Language.SYNTH_TAG_FIELD][FIXED_LEN] > -1) {throw new RangeError(fixedRangeError)} else this[Language.SYNTH_TAG_FIELD]['insertAt'].call(this,index,item)
+        this[Language.SYNTH_TAG_FIELD]['insertAt'].call(this,index,item);
     }
-    
+    /**
+     * @royalesuppressexport
+     */
     public function removeAt(index:int):Object {
-        if (this[Language.SYNTH_TAG_FIELD][FIXED_LEN] > -1) {throw new RangeError(fixedRangeError)} else {
-            const idx:int = index < 0 ? Math.max(this['length'] + index, 0) : index;
-            if (idx >= this['length']) throw new RangeError(indexRangerError(index, this['length']));
-            return this[Language.SYNTH_TAG_FIELD]['removeAt'].call(this, idx);
-        }
+        const idx:int = index < 0 ? Math.max(this['length'] + index, 0) : index;
+        if (idx >= this['length']) throw new RangeError(indexRangerError(index, this['length']));
+        return this[Language.SYNTH_TAG_FIELD]['removeAt'].call(this, idx);
+    }
+    /**
+     * @royalesuppressexport
+     */
+    public function throwRangeError():void{
+        throw new RangeError(fixedRangeError);
     }
     
+    /**
+     * @royalesuppressexport
+     */
     public function chkIdx(index:Number):Number {
         var limit:Number = this[Language.SYNTH_TAG_FIELD][FIXED_LEN];
         var fail:Boolean = index >>> 0 !== index; //fail if not a uint value (also covers negative value range check)
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestVector.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestVector.as
index 19af141..3a14564 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestVector.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/language/LanguageTesterTestVector.as
@@ -1208,5 +1208,66 @@ package flexUnitTests.language
         }
         
         
+        //these accessors/methods etc also serve to visually inspect
+        //the doc comment '@type' annotation in js-debug
+        //it should be:  @type {Array}
+        protected function get instGetterTest():Vector.<String> {
+            return new Vector.<String>();
+        }
+    
+        protected static function get getterTest():Vector.<String> {
+            return new Vector.<String>();
+        }
+    
+    
+        protected function instGetTestVector():Vector.<String> {
+            return new Vector.<String>();
+        }
+    
+        protected static function getTestVector():Vector.<String> {
+            return new Vector.<String>();
+        }
+        
+        protected var instMyVec:Vector.<String> = new Vector.<String>() ;
+    
+        protected static var myVec:Vector.<String> = new Vector.<String>() ;
+    
+        protected static var myVec2:Vector.<TestClass1> = new Vector.<TestClass1>() ;
+    
+        [Test]
+        public function testGetter():void{
+            var vString:Vector.<String> = instGetterTest;
+    
+            Assert.assertTrue('Unexpected Vector check', vString is Vector.<String>);
+            Assert.assertFalse('Unexpected Vector check', vString is Array);
+            
+            vString = instMyVec;
+    
+            Assert.assertTrue('Unexpected Vector check', vString is Vector.<String>);
+            Assert.assertFalse('Unexpected Vector check', vString is Array);
+    
+            vString = instGetTestVector();
+    
+            Assert.assertTrue('Unexpected Vector check', vString is Vector.<String>);
+            Assert.assertFalse('Unexpected Vector check', vString is Array);
+            
+            //static
+            vString = getterTest;
+    
+            Assert.assertTrue('Unexpected Vector check', vString is Vector.<String>);
+            Assert.assertFalse('Unexpected Vector check', vString is Array);
+    
+            vString = getTestVector();
+    
+            Assert.assertTrue('Unexpected Vector check', vString is Vector.<String>);
+            Assert.assertFalse('Unexpected Vector check', vString is Array);
+    
+            vString = myVec;
+    
+            Assert.assertTrue('Unexpected Vector check', vString is Vector.<String>);
+            Assert.assertFalse('Unexpected Vector check', vString is Array);
+        }
+        
+        
     }
 }
diff --git a/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLTesterGeneralTest.as b/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLTesterGeneralTest.as
index 356a024..6b2cf8b 100644
--- a/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLTesterGeneralTest.as
+++ b/manualtests/UnitTests/src/main/royale/flexUnitTests/xml/XMLTesterGeneralTest.as
@@ -700,7 +700,7 @@ package flexUnitTests.xml
             XML.ignoreComments = false;
             var xml:XML = new XML('<root><!-- my test comment --></root>');
             Assert.assertEquals('unexpected comment result with XML.ignoreComments = false', 1, xml.children().length());
-            RoyaleUnitTestRunner.consoleOut(xml.toXMLString());
+
             Assert.assertEquals('unexpected toXMLString with XML.ignoreComments = false',
                     '<root>\n' +
                     '  <!-- my test comment -->\n' +


[royale-asjs] 01/07: Merge branch 'develop' into improvements/Language

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 6a858570720d0647641680d47d44ba1635d4d03d
Merge: 99b6c63 3be398a
Author: greg-dove <gr...@gmail.com>
AuthorDate: Mon May 20 10:52:31 2019 +1200

    Merge branch 'develop' into improvements/Language

 ...l_javascript_libraries_in_Apache_Royale.as3proj |  95 +++++++++++++
 .../README.txt                                     |  29 ++++
 .../asconfig.json                                  |  34 +++++
 .../build.xml                                      |  63 +++++++++
 .../pom.xml                                        |  92 +++++++++++++
 .../resources/jewel-example-index-template.html    |  30 ++++
 ...rnal_javascript_libraries_in_Apache_Royale.mxml |  65 +++++++++
 .../src/main/royale/hljs.as                        |  28 ++++
 examples/royale/ASDoc/ASDoc.as3proj                | 117 ++++++++++++++++
 .../Basic/src/main/resources/basic-manifest.xml    |   1 +
 .../CollectionChangeUpdateForArrayListData.as      | 153 +++++++++++++++++++++
 11 files changed, 707 insertions(+)


[royale-asjs] 06/07: tweaks to build settings to use new line separations support in the additionalCompilerOptions

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 87961c6eafd07b8f1fa1d8ec0f9745261373f3c4
Author: greg-dove <gr...@gmail.com>
AuthorDate: Thu May 23 18:31:56 2019 +1200

    tweaks to build settings to use new line separations support in the additionalCompilerOptions
---
 examples/royale/HelloWorld/pom.xml | 5 +++++
 frameworks/projects/Core/pom.xml   | 9 ++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/examples/royale/HelloWorld/pom.xml b/examples/royale/HelloWorld/pom.xml
index 4d73772..95be5cb 100644
--- a/examples/royale/HelloWorld/pom.xml
+++ b/examples/royale/HelloWorld/pom.xml
@@ -43,6 +43,11 @@
           <debug>false</debug>
           <removeCirculars>true</removeCirculars>
           <mainClass>HelloWorld.mxml</mainClass>
+          <additionalCompilerOptions>
+            -js-complex-implicit-coercions=false;
+            -js-vector-index-checks=false;
+            -js-resolve-uncertain=false;
+          </additionalCompilerOptions>
         </configuration>
       </plugin>
     </plugins>
diff --git a/frameworks/projects/Core/pom.xml b/frameworks/projects/Core/pom.xml
index 2516af3..cb158df 100644
--- a/frameworks/projects/Core/pom.xml
+++ b/frameworks/projects/Core/pom.xml
@@ -53,7 +53,14 @@
           <skipExtern>true</skipExtern>
           <skipAS>${royale.skipAS}</skipAS>
           <allowSubclassOverrides>true</allowSubclassOverrides>
-          <additionalCompilerOptions>-allow-abstract-classes;-js-default-initializers=false;-js-complex-implicit-coercions=false;-js-vector-index-checks=false;-js-resolve-uncertain=false;-source-map=true</additionalCompilerOptions>
+          <additionalCompilerOptions>
+            -allow-abstract-classes;
+            -js-default-initializers=false;
+            -js-complex-implicit-coercions=false;
+            -js-vector-index-checks=false;
+            -js-resolve-uncertain=false;
+            -source-map=true;
+          </additionalCompilerOptions>
         </configuration>
         <!-- As a test, add asdoc generation to the compile step -->
         <executions>


[royale-asjs] 03/07: minor Vector optimizations

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit bc4bf05ad1aab648e14c13300899bd29c7a731ed
Author: greg-dove <gr...@gmail.com>
AuthorDate: Mon May 20 12:23:54 2019 +1200

    minor Vector optimizations
---
 .../src/main/royale/org/apache/royale/utils/Language.as   | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as b/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as
index 8f2a7f2..f21cfce 100644
--- a/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as
+++ b/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as
@@ -544,7 +544,7 @@ package org.apache.royale.utils
                         fixed = l == 2 ? a[--l] : false;
                         size = l == 1 ? a[0] : 0;
                         instance[VectorSupport.ELEMENT_TYPE] = elementType;
-                        instance[VectorSupport.TYPE] = typeName;
+                        instance['type'] = typeName;
                         instance[VectorSupport.FIXED_LEN] = fixed ? size : -1;
                         return VectorSupport.arrayVector([], size, elementType, fixed, instance);
                     },
@@ -628,7 +628,6 @@ class VectorSupport {
     public static const COERCE_ELEMENT:String = goog.DEBUG ? 'coerceElement' : 'cE';
     public static const DEFAULT_VALUE:String = goog.DEBUG ? 'defaultValue' : 'dV';
     public static const ELEMENT_TYPE:String = goog.DEBUG ? 'elementType' : 'eT';
-    public static const TYPE:String = goog.DEBUG ? 'type' : 'ty';
     
     public static const FIXED_LEN:String = goog.DEBUG ? 'fixedLen' : 'fL';
     
@@ -897,21 +896,21 @@ class VectorSupport {
      * @royaleignorecoercion Array
      */
     public function splice():* {
-        var a:Array = Array.prototype.slice.call(arguments) as Array;var inst:Object= this[Language.SYNTH_TAG_FIELD]; var ret:Array = Array.prototype.splice.apply(this, a) as Array; if (inst[FIXED_LEN] > -1) inst[FIXED_LEN] = this['length']; return arrayVector(ret, ret.length, inst[ELEMENT_TYPE], false, null, false);
+        var a:Array = Array.prototype.slice.call(arguments) as Array;var inst:Object= this[Language.SYNTH_TAG_FIELD]; var ret:Array = Array.prototype.splice.apply(this, a) as Array; if (inst[FIXED_LEN] > -1) inst[FIXED_LEN] = this['length']; return tagVectorArray(ret, inst[ELEMENT_TYPE], false, null);
     }
     
     /**
      * @royaleignorecoercion Array
      */
     public function slice():* {
-        var a:Array = Array.prototype.slice.call(arguments) as Array;var inst:Object= this[Language.SYNTH_TAG_FIELD]; var ret:Array = Array.prototype.slice.apply(this, a) as Array; return tagVectorArray(ret, inst[ELEMENT_TYPE], false, null)//arrayVector(ret, ret.length, inst[ELEMENT_TYPE], false, null, false);
+        var a:Array = Array.prototype.slice.call(arguments) as Array;var inst:Object= this[Language.SYNTH_TAG_FIELD]; var ret:Array = Array.prototype.slice.apply(this, a) as Array; return tagVectorArray(ret, inst[ELEMENT_TYPE], false, null);
     }
     
     /**
      * @royaleignorecoercion Array
      */
     public function filter():* {
-        var a:Array = Array.prototype.slice.call(arguments) as Array;var inst:Object= this[Language.SYNTH_TAG_FIELD]; var ret:Array = Array.prototype.filter.apply(this, a) as Array; return arrayVector(ret, ret.length, inst[ELEMENT_TYPE], false, null, false);
+        var a:Array = Array.prototype.slice.call(arguments) as Array;var inst:Object= this[Language.SYNTH_TAG_FIELD]; var ret:Array = Array.prototype.filter.apply(this, a) as Array; return tagVectorArray(ret, inst[ELEMENT_TYPE], false, null);
     }
     
     /**
@@ -923,12 +922,12 @@ class VectorSupport {
         var l:uint = a.length;
         for (var i:int = 0; i<l; i++) {
             var contender:Array = a[i] as Array;
-            if (!checkIsVector(contender, inst[TYPE] as String)) {
-                throw new TypeError('Error #1034: Type Coercion failed: cannot convert ' + contender[Language.SYNTH_TAG_FIELD][TYPE] + ' to ' + inst[TYPE]);
+            if (!checkIsVector(contender, inst['type'] as String)) {
+                throw new TypeError('Error #1034: Type Coercion failed: cannot convert ' + contender[Language.SYNTH_TAG_FIELD]['type'] + ' to ' + inst['type']);
             }
         }
         var ret:Array = Array.prototype.concat.apply(this, a) as Array;
-        return arrayVector(ret, ret.length, inst[ELEMENT_TYPE], false, null, false);
+        return tagVectorArray(ret,inst[ELEMENT_TYPE], false, null);
     }
     
     public function uncheckedInsertAt(index:Number,item:*):* {


[royale-asjs] 02/07: Add js-release output to HelloWorld maven build

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f2701572ff424039f121e1c4dba1beae630d7377
Author: greg-dove <gr...@gmail.com>
AuthorDate: Mon May 20 12:05:16 2019 +1200

    Add js-release output to HelloWorld maven build
---
 examples/royale/HelloWorld/pom.xml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/examples/royale/HelloWorld/pom.xml b/examples/royale/HelloWorld/pom.xml
index 9f76b2d..4d73772 100644
--- a/examples/royale/HelloWorld/pom.xml
+++ b/examples/royale/HelloWorld/pom.xml
@@ -39,6 +39,9 @@
         <artifactId>royale-maven-plugin</artifactId>
         <extensions>true</extensions>
         <configuration>
+          <targets>SWF,JSRoyale</targets>
+          <debug>false</debug>
+          <removeCirculars>true</removeCirculars>
           <mainClass>HelloWorld.mxml</mainClass>
         </configuration>
       </plugin>
@@ -47,6 +50,13 @@
 
   <dependencies>
     <dependency>
+      <groupId>com.adobe.flash.framework</groupId>
+      <artifactId>playerglobal</artifactId>
+      <version>${flash.version}</version>
+      <type>swc</type>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
       <groupId>org.apache.royale.framework</groupId>
       <artifactId>Basic</artifactId>
       <version>0.9.6-SNAPSHOT</version>


[royale-asjs] 07/07: Merge branch 'develop' into improvements/Language

Posted by gr...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit adfc97543e317a5ae673cb4585a128a8a625910c
Merge: 87961c6 c9943e1
Author: greg-dove <gr...@gmail.com>
AuthorDate: Thu May 23 18:38:38 2019 +1200

    Merge branch 'develop' into improvements/Language

 .gitignore                                         |   1 +
 frameworks/ace-config.xml                          | 347 ---------------------
 frameworks/build.xml                               |  14 +-
 frameworks/js/projects/AceJS/build.xml             |  51 +--
 frameworks/js/projects/BasicJS/build.xml           |  51 +--
 .../projects/BasicJS}/src/test/royale/build.xml    |  96 +++---
 frameworks/js/projects/BindingJS/build.xml         |  51 +--
 frameworks/js/projects/ChartsJS/build.xml          |  51 +--
 frameworks/js/projects/CollectionsJS/build.xml     |  51 +--
 frameworks/js/projects/CoreJS/build.xml            |  51 +--
 .../projects/CoreJS}/src/test/royale/build.xml     |  96 +++---
 frameworks/js/projects/CreateJSJS/build.xml        |  51 +--
 frameworks/js/projects/DragDropJS/build.xml        |  51 +--
 frameworks/js/projects/EffectsJS/build.xml         |  51 +--
 frameworks/js/projects/ExpressJS/build.xml         |  51 +--
 frameworks/js/projects/FlatJS/build.xml            |  51 +--
 frameworks/js/projects/FontAwesomeJS/build.xml     |  51 +--
 frameworks/js/projects/FormattersJS/build.xml      |  51 +--
 frameworks/js/projects/GoogleMapsJS/build.xml      |  51 +--
 frameworks/js/projects/GraphicsJS/build.xml        |  51 +--
 frameworks/js/projects/HTML5JS/build.xml           |  51 +--
 frameworks/js/projects/HTMLJS/build.xml            |  51 +--
 frameworks/js/projects/IconsJS/build.xml           |  51 +--
 frameworks/js/projects/JQueryJS/build.xml          |  51 +--
 frameworks/js/projects/JewelJS/build.xml           |  51 +--
 frameworks/js/projects/LanguageJS/build.xml        |  51 +--
 frameworks/js/projects/MXRoyaleJS/build.xml        |  51 +--
 .../js/projects/MaterialDesignLiteJS/build.xml     |  51 +--
 frameworks/js/projects/MobileJS/build.xml          |  51 +--
 frameworks/js/projects/NetworkJS/build.xml         |  51 +--
 frameworks/js/projects/ReflectionJS/build.xml      |  51 +--
 frameworks/js/projects/RoyaleSiteJS/build.xml      |  51 +--
 frameworks/js/projects/RoyaleUnitJS/build.xml      |  51 +--
 .../RoyaleUnitJS}/src/test/royale/build.xml        |  96 +++---
 frameworks/js/projects/SparkRoyaleJS/build.xml     |  51 +--
 frameworks/js/projects/StorageJS/build.xml         |  51 +--
 frameworks/js/projects/TLFJS/build.xml             |  51 +--
 frameworks/js/projects/TextJS/build.xml            |  51 +--
 frameworks/js/projects/XMLJS/build.xml             |  55 ++--
 .../html/supportClasses/ColorItemRenderer.as       |  36 +--
 .../royale/FlexUnitRoyaleApplication-config.xml    |  27 +-
 .../src/test/royale/FlexUnitRoyaleApplication.mxml |  11 +-
 .../projects/Basic/src/test/royale/build.xml       |  37 +--
 .../royale/FlexUnitRoyaleApplication-config.xml    |  29 +-
 .../src/test/royale/FlexUnitRoyaleApplication.mxml |  11 +-
 frameworks/projects/Core/src/test/royale/build.xml |  37 +--
 .../main/royale/org/apache/royale/jewel/Grid.as    |   2 +-
 .../main/royale/org/apache/royale/jewel/TabBar.as  |   2 +-
 .../src/main/royale/RoyaleUnitClasses.as           |   6 +-
 .../org/apache/royale/test/listeners/CIListener.as | 102 +++++-
 .../royale/FlexUnitRoyaleApplication-config.xml    |  27 +-
 .../src/test/royale/FlexUnitRoyaleApplication.mxml |  11 +-
 .../projects/RoyaleUnit/src/test/royale/build.xml  |  37 +--
 53 files changed, 1242 insertions(+), 1470 deletions(-)