royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com.INVALID>
Subject Re: [royale-asjs] 01/01: Added Map
Date Sun, 25 Feb 2018 17:12:37 GMT
Hmm.  Probably the compiler thinks Map.as is a monkey-patch over the SWC
definition.  Source-path definitions always win.

What error do you get?

HTH,
-Alex

On 2/25/18, 3:32 AM, "Harbs" <harbs.lists@gmail.com> wrote:

>I need help here:
>
>By adding the Map class for SWF, that seems to mess up the Map reference
>in JS blocks in ObjectMap. For some reason, the SWF class makes the
>compiler not find the extern definition of Map on the JS side. I’m not
>sure why.
>
>Any thoughts?
>Harbs
>
>> On Feb 25, 2018, at 1:30 PM, harbs@apache.org wrote:
>> 
>> This is an automated email from the ASF dual-hosted git repository.
>> 
>> harbs pushed a commit to branch feature/native-js
>> in repository 
>>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.a
>>pache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7Caharui%40adobe.c
>>om%7Ca4bd776070724b1dcc1808d57c4378ec%7Cfa7b1b5a7b34438794aed2c178decee1%
>>7C0%7C0%7C636551551615381068&sdata=8rGGfy%2B3oPjqQEuqvMvxA1KB5t4lDS%2FLWH
>>kDRxsrkmU%3D&reserved=0
>> 
>> commit fa36e70dc9dfd924db30a512f1a2f8622e218ae4
>> Author: Harbs <harbs@in-tools.com>
>> AuthorDate: Sun Feb 25 13:30:10 2018 +0200
>> 
>>    Added Map
>> ---
>> .../projects/Core/src/main/royale/CoreClasses.as   |   6 ++
>> frameworks/projects/Core/src/main/royale/Map.as    | 101
>>+++++++++++++++++++++
>> 2 files changed, 107 insertions(+)
>> 
>> diff --git a/frameworks/projects/Core/src/main/royale/CoreClasses.as
>>b/frameworks/projects/Core/src/main/royale/CoreClasses.as
>> index 0408118..fc9595e 100644
>> --- a/frameworks/projects/Core/src/main/royale/CoreClasses.as
>> +++ b/frameworks/projects/Core/src/main/royale/CoreClasses.as
>> @@ -224,6 +224,12 @@ internal class CoreClasses
>> 		import org.apache.royale.core.WrappedHTMLElement ;WrappedHTMLElement;
>> 	    import org.apache.royale.core.IRoyaleElement; IRoyaleElement;
>> 	}
>> +
>> +	//JS native classes
>> +	COMPILE::SWF
>> +	{
>> +		import Map; Map;
>> +	}
>> 	//Package Level Functions
>> 	import org.apache.royale.debugging.assert; assert;
>> 	import org.apache.royale.debugging.assertType; assertType;
>> diff --git a/frameworks/projects/Core/src/main/royale/Map.as
>>b/frameworks/projects/Core/src/main/royale/Map.as
>> new file mode 100644
>> index 0000000..e2549ea
>> --- /dev/null
>> +++ b/frameworks/projects/Core/src/main/royale/Map.as
>> @@ -0,0 +1,101 @@
>> 
>>+////////////////////////////////////////////////////////////////////////
>>////////
>> +//
>> +//  Licensed to the Apache Software Foundation (ASF) under one or more
>> +//  contributor license agreements.  See the NOTICE file distributed
>>with
>> +//  this work for additional information regarding copyright ownership.
>> +//  The ASF licenses this file to You under the Apache License,
>>Version 2.0
>> +//  (the "Licens"); you may not use this file except in compliance with
>> +//  the License.  You may obtain a copy of the License at
>> +//
>> +//      
>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.apach
>>e.org%2Flicenses%2FLICENSE-2.0&data=02%7C01%7Caharui%40adobe.com%7Ca4bd77
>>6070724b1dcc1808d57c4378ec%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6
>>36551551615381068&sdata=9Ja2Y3rXZc4hhbn85tmZyHq8lE8FQkbl%2B%2BgTaFzKUVY%3
>>D&reserved=0
>> +//
>> +//  Unless required by applicable law or agreed to in writing, software
>> +//  distributed under the License is distributed on an "AS IS" BASIS,
>> +//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>implied.
>> +//  See the License for the specific language governing permissions and
>> +//  limitations under the License.
>> +//
>> 
>>+////////////////////////////////////////////////////////////////////////
>>////////
>> +package
>> +{
>> +    COMPILE::SWF
>> +    {
>> +        import flash.utils.Dictionary;
>> +    }
>> +    COMPILE::SWF
>> +    public class Map
>> +    {
>> +        public function Map(iterable:Object=null)
>> +        {
>> +            dict = new Dictionary();
>> +        }
>> +
>> +        private var dict:Dictionary;
>> +        public static const length:int = 0;
>> +
>> +        private var _keys:Array = [];
>> +        public function get size():int
>> +        {
>> +            return _keys.length;
>> +        }
>> +
>> +        public function clear():void
>> +        {
>> +            dict = new Dictionary();
>> +            _keys = [];
>> +        }
>> +
>> +        public function delete(key:*):Boolean
>> +        {
>> +            var idx:int = _keys.indexOf(key);
>> +            if(idx != -1){
>> +                _keys.splice(idx,1);
>> +            }
>> +            return delete dict[key];
>> +        }
>> +
>> +        //TODO requires Iterator
>> +        // public function entries():Iterator
>> +        // {
>> +            
>> +        // }
>> +
>> +        public function forEach(callback:Function,thisArg:Object =
>>null):void
>> +        {
>> +            thisArg = thisArg ? thisArg : this;
>> +            var len:int = _keys.length;
>> +            for(var i:int = 0; i < len; i++)
>> +            {
>> +                callback.call(thisArg,dict[_keys[i]],i,this);
>> +            }
>> +        }
>> +
>> +        public function get(key:Object):*
>> +        {
>> +            return dict[key];
>> +        }
>> +
>> +        public function has(key:Object):Boolean
>> +        {
>> +            return dict[key] != null;
>> +        }
>> +
>> +        //TODO requires Iterator
>> +        // public function keys():Iterator
>> +        // {
>> +            
>> +        // }
>> +
>> +        public function set(key:Object,value:*):Map
>> +        {
>> +            dict[key] = value;
>> +            return this;
>> +        }
>> +
>> +        //TODO requires Iterator
>> +        // public function values():Iterator
>> +        // {
>> +            
>> +        // }
>> +    }
>> +}
>> \ No newline at end of file
>> 
>> -- 
>> To stop receiving notification emails like this one, please contact
>> harbs@apache.org.
>

Mime
View raw message