flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject git commit: [flex-asjs] [refs/heads/develop] - Fixed ObjectMap Added OSUtils
Date Wed, 15 Feb 2017 09:28:59 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop e4997620c -> 11f0017c3


Fixed ObjectMap
Added OSUtils


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/11f0017c
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/11f0017c
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/11f0017c

Branch: refs/heads/develop
Commit: 11f0017c333671fbe75e0a159ba34eab911f1d0b
Parents: e499762
Author: Harbs <harbs@in-tools.com>
Authored: Wed Feb 15 11:28:53 2017 +0200
Committer: Harbs <harbs@in-tools.com>
Committed: Wed Feb 15 11:28:53 2017 +0200

----------------------------------------------------------------------
 .../projects/Core/src/main/flex/CoreClasses.as  |  1 +
 .../main/flex/org/apache/flex/utils/OSUtils.as  | 82 ++++++++++++++++++++
 .../flex/org/apache/flex/utils/ObjectMap.as     |  8 +-
 3 files changed, 87 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11f0017c/frameworks/projects/Core/src/main/flex/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as
index 38dabd9..3c79ea4 100644
--- a/frameworks/projects/Core/src/main/flex/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as
@@ -149,6 +149,7 @@ internal class CoreClasses
     import org.apache.flex.utils.CompressionUtils; CompressionUtils;
 	import org.apache.flex.utils.Endian; Endian;
 	import org.apache.flex.utils.JXON; JXON;
+	import org.apache.flex.utils.OSUtils; OSUtils;
     import org.apache.flex.utils.StringPadder; StringPadder;
 	import org.apache.flex.utils.StringTrimmer; StringTrimmer;
 	import org.apache.flex.utils.StringUtil; StringUtil;

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11f0017c/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/OSUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/OSUtils.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/OSUtils.as
new file mode 100644
index 0000000..d24e50d
--- /dev/null
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/OSUtils.as
@@ -0,0 +1,82 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.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 org.apache.flex.utils
+{
+	/**
+	 *  The OSUtils class is an all-static class with methods for
+	 *  getting informatiojn about the host operating system.
+	 *  You do not create instances of OSUtils;
+	 *  instead you call methods such as 
+	 *  the <code>OSUtils.getOS()</code> method.  
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 3
+	 *  @productversion FlexJS 0.0
+	 */
+    public class OSUtils
+    {
+        COMPILE::SWF
+        {
+            import flash.system.Capabilities;
+        }
+        public function OSUtils ()
+        {
+        }
+
+        /**
+         * Gets the name of the operating system.
+         */
+        public static function getOS():String
+        {
+            COMPILE::SWF
+            {
+                if(!_osName)
+                {
+                    if(Capabilities.os.indexOf("Mac OS") != -1)
+                        _osName = "MacOS";
+                    else if(Capabilities.os.indexOf("Windows") != -1)
+                        _osName = "Windows";
+                    else if(Capabilities.os.indexOf("Linux") != -1)
+                        _osName = "Linux";
+                    else
+                        _osName = "Unknown OS";
+                }
+                return _osName;
+            }
+
+            COMPILE::JS
+            {
+                if(!_osName)
+                {
+                    _osName = "Unknown OS";
+                    var appVersion:String = navigator.appVersion;
+                    if (appVersion.indexOf("Win") != -1) _osName="Windows";
+                    if (appVersion.indexOf("Mac") != -1) _osName="MacOS";
+                    if (appVersion.indexOf("X11") != -1) _osName="UNIX";
+                    if (appVersion.indexOf("Linux") != -1) _osName="Linux";
+                }
+                return _osName;
+            }
+        }
+        
+        private static var _osName:String;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11f0017c/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/ObjectMap.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/ObjectMap.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/ObjectMap.as
index 0091535..eff5859 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/ObjectMap.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/ObjectMap.as
@@ -115,10 +115,10 @@ package org.apache.flex.utils
         COMPILE::JS
         private function assignFunctions():void
         {
-            this.get = _map.get;
-            this.has = _map.has;
-            this.set = _map.set;
-            this.delete = _map.delete;
+            this.get = _map.get.bind(_map);
+            this.has = _map.has.bind(_map);
+            this.set = _map.set.bind(_map);
+            this.delete = _map.delete.bind(_map);
         }
 
         COMPILE::JS


Mime
View raw message