You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by jm...@apache.org on 2017/05/21 16:37:04 UTC

[01/10] git commit: [flex-asjs] [refs/heads/develop] - use === and !== rather than == and !=

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 12cad35ec -> a3d6ae413


use === and !== rather than == and !=


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

Branch: refs/heads/develop
Commit: 47ddad39404d0c106865352684b3d724e1a556e4
Parents: 12cad35
Author: Justin Mclean <jm...@apache.org>
Authored: Sun May 21 06:48:06 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun May 21 06:48:06 2017 +1000

----------------------------------------------------------------------
 .../org/apache/flex/core/SimpleCSSValuesImpl.as | 80 ++++++++++----------
 1 file changed, 40 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/47ddad39/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index 6b0527d..d7315f2 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -158,9 +158,9 @@ package org.apache.flex.core
         COMPILE::SWF
         public function generateCSSStyleDeclarations(factoryFunctions:Object, arr:Array):void
         {
-			if (factoryFunctions == null)
+			if (factoryFunctions === null)
 				return;
-			if (arr == null)
+			if (arr === null)
 				return;
 			
             var declarationName:String = "";
@@ -169,16 +169,16 @@ package org.apache.flex.core
             for (var i:int = 0; i < n; i++)
             {
                 var className:int = arr[i];
-                if (className == CSSClass.CSSSelector)
+                if (className === CSSClass.CSSSelector)
                 {
                     var selectorName:String = arr[++i];
                     segmentName = selectorName + segmentName;
-                    if (declarationName != "")
+                    if (declarationName !== "")
                         declarationName += " ";
                     declarationName += segmentName;
                     segmentName = "";
                 }
-                else if (className == CSSClass.CSSCondition)
+                else if (className === CSSClass.CSSCondition)
                 {
 					if (!conditionCombiners)
 					{
@@ -191,23 +191,23 @@ package org.apache.flex.core
 					var conditionName:String = arr[++i];
 					segmentName = segmentName + conditionCombiners[conditionType] + conditionName;
                 }
-                else if (className == CSSClass.CSSStyleDeclaration)
+                else if (className === CSSClass.CSSStyleDeclaration)
                 {
                     var factoryName:int = arr[++i]; // defaultFactory or factory
-                    var defaultFactory:Boolean = factoryName == CSSFactory.DefaultFactory;
+                    var defaultFactory:Boolean = factoryName === CSSFactory.DefaultFactory;
                     /*
                     if (defaultFactory)
                     {
                         mergedStyle = styleManager.getMergedStyleDeclaration(declarationName);
-                        style = new CSSStyleDeclaration(selector, styleManager, mergedStyle == null);
+                        style = new CSSStyleDeclaration(selector, styleManager, mergedStyle === null);
                     }
                     else
                     {
                         style = styleManager.getStyleDeclaration(declarationName);
                         if (!style)
                         {
-                            style = new CSSStyleDeclaration(selector, styleManager, mergedStyle == null);
-                            if (factoryName == CSSFactory.Override)
+                            style = new CSSStyleDeclaration(selector, styleManager, mergedStyle === null);
+                            if (factoryName === CSSFactory.Override)
                                 newSelectors.push(style);
                         }
                     }
@@ -217,7 +217,7 @@ package org.apache.flex.core
                     if (i < n - 2)
                     {
                         // peek ahead to see if there is a media query
-                        if (arr[i + 1] == CSSClass.CSSMediaQuery)
+                        if (arr[i + 1] === CSSClass.CSSMediaQuery)
                         {
                             mq = arr[i + 2];
                             i += 2;
@@ -241,7 +241,7 @@ package org.apache.flex.core
                     {
                         finalName = fixNames(declarationName, mq);
                         o = values[finalName];
-                        if (o == null)
+                        if (o === null)
                             values[finalName] = valuesObject;
                         else
                         {
@@ -257,10 +257,10 @@ package org.apache.flex.core
 
         private function isValidStaticMediaQuery(mq:String):Boolean
         {
-            if (mq == null)
+            if (mq === null)
                 return true;
             
-            if (mq == "-flex-flash")
+            if (mq === "-flex-flash")
                 return true;
             
             // TODO: (aharui) other media query
@@ -270,10 +270,10 @@ package org.apache.flex.core
         
         private function fixNames(s:String, mq:String):String
         {
-            if (mq != null)
+            if (mq !== null)
                 s = s.substr(mq.length + 1); // 1 more for the hyphen
             
-			if (s == "")
+			if (s === "")
 				return "*";
 			
             var arr:Array = s.split(" ");
@@ -281,7 +281,7 @@ package org.apache.flex.core
             for (var i:int = 0; i < n; i++)
             {
                 var segmentName:String = arr[i];
-				if (segmentName.charAt(0) == "#" || segmentName.charAt(0) == ".")
+				if (segmentName.charAt(0) === "#" || segmentName.charAt(0) === ".")
 					continue;
 				
                 var c:int = segmentName.lastIndexOf(".");
@@ -316,7 +316,7 @@ package org.apache.flex.core
 		public function getValue(thisObject:Object, valueName:String, state:String = null, attrs:Object = null):*
 		{
             var c:int = valueName.indexOf("-");
-            while (c != -1)
+            while (c !== -1)
             {
                 valueName = valueName.substr(0, c) +
                     valueName.charAt(c + 1).toUpperCase() +
@@ -332,7 +332,7 @@ package org.apache.flex.core
 			if (thisObject is IStyleableObject)
 			{
                 var styleable:IStyleableObject = IStyleableObject(thisObject);
-                if (styleable.style != null)
+                if (styleable.style !== null)
                 {
                     try {
                         value = styleable.style[valueName];
@@ -340,18 +340,18 @@ package org.apache.flex.core
                     catch (e:Error) {
                         value = undefined;
                     }
-                    if (value == "inherit")
+                    if (value === "inherit")
                         return getInheritingValue(thisObject, valueName, state, attrs);
                     if (value !== undefined)
                         return value;
                 }
-                if (styleable.id != null)
+                if (styleable.id !== null)
                 {
                     o = values["#" + styleable.id];
                     if (o)
                     {
                         value = o[valueName];
-                        if (value == "inherit")
+                        if (value === "inherit")
                             return getInheritingValue(thisObject, valueName, state, attrs);
                         if (value !== undefined)
                             return value;
@@ -370,7 +370,7 @@ package org.apache.flex.core
                             if (o)
                             {
                                 value = o[valueName];
-                                if (value == "inherit")
+                                if (value === "inherit")
                                     return getInheritingValue(thisObject, valueName, state, attrs);
                                 if (value !== undefined)
                                     return value;
@@ -381,7 +381,7 @@ package org.apache.flex.core
                         if (o)
                         {
                             value = o[valueName];
-                            if (value == "inherit")
+                            if (value === "inherit")
                                 return getInheritingValue(thisObject, valueName, state, attrs);
                             if (value !== undefined)
                                 return value;
@@ -399,7 +399,7 @@ package org.apache.flex.core
                 className = thisObject.FLEXJS_CLASS_INFO.names[0].qName;
             }
             var thisInstance:Object = thisObject;
-			while (className != "Object")
+			while (className !== "Object")
 			{
 				if (state)
 				{
@@ -408,7 +408,7 @@ package org.apache.flex.core
 					if (o)
 					{
 						value = o[valueName];
-                        if (value == "inherit")
+                        if (value === "inherit")
                             return getInheritingValue(thisObject, valueName, state, attrs);
 						if (value !== undefined)
 							return value;
@@ -419,7 +419,7 @@ package org.apache.flex.core
 	            if (o)
 	            {
 	                value = o[valueName];
-                    if (value == "inherit")
+                    if (value === "inherit")
                         return getInheritingValue(thisObject, valueName, state, attrs);
 	                if (value !== undefined)
 	                    return value;
@@ -440,7 +440,7 @@ package org.apache.flex.core
                 }
 			}
             
-            if (inheritingStyles[valueName] != null && 
+            if (inheritingStyles[valueName] !== null &&
                 thisObject is IChild)
             {
                 var parentObject:Object = IChild(thisObject).parent;
@@ -472,7 +472,7 @@ package org.apache.flex.core
                 if (parentObject)
                 {
                     value = getValue(parentObject, valueName, state, attrs);
-                    if (value == "inherit" || value === undefined)
+                    if (value === "inherit" || value === undefined)
                         return getInheritingValue(parentObject, valueName, state, attrs);
                     if (value !== undefined)
                         return value;
@@ -500,7 +500,7 @@ package org.apache.flex.core
 		public function setValue(thisObject:Object, valueName:String, value:*):void
 		{
             var c:int = valueName.indexOf("-");
-            while (c != -1)
+            while (c !== -1)
             {
                 valueName = valueName.substr(0, c) +
                     valueName.charAt(c + 1).toUpperCase() +
@@ -508,7 +508,7 @@ package org.apache.flex.core
                 c = valueName.indexOf("-");
             }
 			var oldValue:Object = values[valueName];
-			if (oldValue != value)
+			if (oldValue !== value)
 			{
 				values[valueName] = value;
 				dispatchEvent(new ValueChangeEvent(ValueChangeEvent.VALUE_CHANGE, false, false, oldValue, value));
@@ -593,26 +593,26 @@ package org.apache.flex.core
             {
                 var pieces:Array = StringUtil.splitAndTrim(part, ":");
                 var value:String = pieces[1];
-                if (value == "null")
+                if (value === "null")
                     obj[pieces[0]] = null;
-                else if (value == "true")
+                else if (value === "true")
                     obj[pieces[0]] = true;
-                else if (value == "false")
+                else if (value === "false")
                     obj[pieces[0]] = false;
                 else
                 {
                     var n:Number = Number(value);
                     if (isNaN(n))
                     {
-                        if (value.charAt(0) == "#" || value.indexOf("rgb") == 0)
+                        if (value.charAt(0) === "#" || value.indexOf("rgb") === 0)
                         {                            
                             obj[pieces[0]] = CSSUtils.toColor(value);
                         }
                         else
                         {
-                            if (value.charAt(0) == "'")
+                            if (value.charAt(0) === "'")
                                 value = value.substr(1, value.length - 2);
-                            else if (value.charAt(0) == '"')
+                            else if (value.charAt(0) === '"')
                                 value = value.substr(1, value.length - 2);
                             obj[pieces[0]] = value;
                         }
@@ -639,7 +639,7 @@ package org.apache.flex.core
             {
                 var v:* = values[valueName];
                 var c:int = valueName.indexOf("-");
-                while (c != -1)
+                while (c !== -1)
                 {
                     valueName = valueName.substr(0, c) +
                         valueName.charAt(c + 1).toUpperCase() +
@@ -734,7 +734,7 @@ package org.apache.flex.core
                 var value:* = styles[p];
                 if (value === undefined)
                     continue;
-                if (typeof(value) == 'number') {
+                if (typeof(value) === 'number') {
                     if (colorStyles[p])
                         value = CSSUtils.attributeFromColor(value);
                     else if (numericStyles[p])
@@ -742,7 +742,7 @@ package org.apache.flex.core
                     else
                         value = value.toString() + 'px';
                 }
-                else if (p == 'backgroundImage') {
+                else if (p === 'backgroundImage') {
                     if (p.indexOf('url') !== 0)
                         value = 'url(' + value + ')';
                 }


[04/10] git commit: [flex-asjs] [refs/heads/develop] - values parameter hiding property

Posted by jm...@apache.org.
values parameter hiding property


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

Branch: refs/heads/develop
Commit: 8172e19ccf3393258cb28563355ac622ddc30b78
Parents: 1ec5412
Author: Justin Mclean <jm...@apache.org>
Authored: Sun May 21 07:29:27 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun May 21 07:29:27 2017 +1000

----------------------------------------------------------------------
 .../org/apache/flex/core/SimpleCSSValuesImpl.as | 26 ++++++++++----------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8172e19c/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index dd8b88a..45b3779 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -81,7 +81,7 @@ package org.apache.flex.core
 			if (!values)
 			{
 				values = {};
-	            this.mainClass = main;
+	            mainClass = main;
 	            var mainClassName:String = getQualifiedClassName(mainClass);
 				styleClassName = "_" + mainClassName + "_Styles";
 				c = ApplicationDomain.currentDomain.getDefinition(styleClassName) as Class;
@@ -110,12 +110,12 @@ package org.apache.flex.core
         public function init(main:Object):void
         {
             var cssData:Array = main.cssData;
-            var values:Object = this.values;
+            var newValues:Object = values;
 
-            this.mainClass = main;
+            mainClass = main;
 
-            if (values == null)
-                values = {};
+            if (newValues == null)
+                newValues = {};
             
             if (cssData) {
                 var n:int = cssData.length;
@@ -134,19 +134,19 @@ package org.apache.flex.core
                     for (var j:int = 0; j < numSel; j++)
                     {
                         var selName:String = cssData[i++];
-                        if (values[selName])
+                        if (newValues[selName])
                         {
-                            props = values[selName];
+                            props = newValues[selName];
                             propFn.prototype = props;
                         }
-                        values[selName] = new propFn();
+                        newValues[selName] = new propFn();
                     }
                     // skip the propFn
                     props = cssData[i++];
                 }
             }
             
-            this.values = values;            
+            values = newValues;
         }
         
         /**
@@ -635,12 +635,12 @@ package org.apache.flex.core
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          */
-        public function addRule(ruleName:String, values:Object):void
+        public function addRule(ruleName:String, ruleValues:Object):void
         {
             var asValues:Object = {};
-            for (var valueName:String in values)
+            for (var valueName:String in ruleValues)
             {
-                var v:* = values[valueName];
+                var v:* = ruleValues[valueName];
                 var c:int = valueName.indexOf("-");
                 while (c !== -1)
                 {
@@ -651,7 +651,7 @@ package org.apache.flex.core
                 }
                 asValues[valueName] = v;
             }
-            this.values[ruleName] = asValues;
+            values[ruleName] = asValues;
         }
         
         /**


[09/10] git commit: [flex-asjs] [refs/heads/develop] - missed a couple of ==

Posted by jm...@apache.org.
missed a couple of ==


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

Branch: refs/heads/develop
Commit: 60f614aff0ef3c32259182863b35d8eb1a7baf04
Parents: 5dd19cc
Author: Justin Mclean <jm...@apache.org>
Authored: Sun May 21 09:16:32 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun May 21 09:16:32 2017 +1000

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/60f614af/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index 3668b9c..d854ca4 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -100,7 +100,7 @@ package org.apache.flex.core
             {
                 var ffName:String = "factoryFunctions" + i.toString();
                 var ff:Object = c[ffName];
-                if (ff == null)
+                if (ff === null)
                     break;
                 generateCSSStyleDeclarations(c[ffName], c["data" + i.toString()]);
                 if (hasEventListener("init"))
@@ -117,7 +117,7 @@ package org.apache.flex.core
 
             mainClass = main;
 
-            if (newValues == null)
+            if (newValues === null)
                 newValues = {};
             
             if (cssData) {


[02/10] git commit: [flex-asjs] [refs/heads/develop] - add missing semicolons

Posted by jm...@apache.org.
add missing semicolons


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

Branch: refs/heads/develop
Commit: 004d2044bfa04ed15f65cd66e98f0f43a14b8cfd
Parents: 47ddad3
Author: Justin Mclean <jm...@apache.org>
Authored: Sun May 21 06:50:47 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun May 21 06:50:47 2017 +1000

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/004d2044/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index d7315f2..391d54d 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -665,7 +665,7 @@ package org.apache.flex.core
             "fontSize" : 1,
             "fontStyle" : 1,
             "textAlign" : 1
-        }
+        };
 
         /**
          * The styles that apply to each UI widget
@@ -679,7 +679,7 @@ package org.apache.flex.core
             'fontWeight': 1,
             'fontSize': 1,
             'fontStyle': 1
-        }
+        };
         
         
         /**
@@ -690,7 +690,7 @@ package org.apache.flex.core
             'backgroundColor': 1,
             'borderColor': 1,
             'color': 1
-        }
+        };
 
         /**
          * The styles that can use raw numbers
@@ -698,7 +698,7 @@ package org.apache.flex.core
         COMPILE::JS
         public static var numericStyles:Object = {
             'fontWeight': 1
-        }
+        };
         
         
         /**
@@ -707,7 +707,7 @@ package org.apache.flex.core
         COMPILE::JS
         public static var skipStyles:Object = {
             'constructor': 1
-        }
+        };
         
         
 


[06/10] git commit: [flex-asjs] [refs/heads/develop] - helps if you declare var

Posted by jm...@apache.org.
helps if you declare var


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

Branch: refs/heads/develop
Commit: f58e9680d7c23b938402cbf113f68fbb8fbb33fd
Parents: efd7ec0
Author: Justin Mclean <jm...@apache.org>
Authored: Sun May 21 07:38:38 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun May 21 07:38:38 2017 +1000

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f58e9680/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index 2b0c124..4b67cae 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -169,6 +169,8 @@ package org.apache.flex.core
             var declarationName:String = "";
             var segmentName:String = "";
             var n:int = arr.length;
+            var i:int = 0;
+            
             while (i < n)
             {
                 var className:int = arr[i];
@@ -663,7 +665,7 @@ package org.apache.flex.core
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          */
-        public static var inheritingStyles:Object = { 
+        public static var inheritingStyles:Object = {
             "color" : 1,
             "fontFamily" : 1,
             "fontSize" : 1,


[07/10] git commit: [flex-asjs] [refs/heads/develop] - make nested if statements a little more readable

Posted by jm...@apache.org.
make nested if statements a little more readable


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

Branch: refs/heads/develop
Commit: 43dab1d5a9137b87ffcfa5389707cd50e3f30041
Parents: f58e968
Author: Justin Mclean <jm...@apache.org>
Authored: Sun May 21 07:43:40 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun May 21 07:43:40 2017 +1000

----------------------------------------------------------------------
 .../org/apache/flex/core/SimpleCSSValuesImpl.as | 26 +++++++++-----------
 1 file changed, 11 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/43dab1d5/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index 4b67cae..d797172 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -219,15 +219,12 @@ package org.apache.flex.core
                     */
                     var mq:String = null;
                     var o:Object;
-                    if (i < n - 2)
+                    // peek ahead to see if there is a media query
+                    if (i < n - 2 && arr[i + 1] === CSSClass.CSSMediaQuery)
                     {
-                        // peek ahead to see if there is a media query
-                        if (arr[i + 1] === CSSClass.CSSMediaQuery)
-                        {
-                            mq = arr[i + 2];
-                            i += 2;
-                            declarationName = mq + "_" + declarationName;
-                        }
+                        mq = arr[i + 2];
+                        i += 2;
+                        declarationName = mq + "_" + declarationName;
                     }
                     var finalName:String;
                     var valuesFunction:Function;
@@ -665,7 +662,7 @@ package org.apache.flex.core
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          */
-        public static var inheritingStyles:Object = {
+        public static const inheritingStyles:Object = {
             "color" : 1,
             "fontFamily" : 1,
             "fontSize" : 1,
@@ -677,7 +674,7 @@ package org.apache.flex.core
          * The styles that apply to each UI widget
          */
         COMPILE::JS
-        public static var perInstanceStyles:Object = {
+        public static const perInstanceStyles:Object = {
             'backgroundColor': 1,
             'backgroundImage': 1,
             'color': 1,
@@ -692,7 +689,7 @@ package org.apache.flex.core
          * The styles that use color format #RRGGBB
          */
         COMPILE::JS
-        public static var colorStyles:Object = {
+        public static const colorStyles:Object = {
             'backgroundColor': 1,
             'borderColor': 1,
             'color': 1
@@ -702,7 +699,7 @@ package org.apache.flex.core
          * The styles that can use raw numbers
          */
         COMPILE::JS
-        public static var numericStyles:Object = {
+        public static const numericStyles:Object = {
             'fontWeight': 1
         };
         
@@ -711,7 +708,7 @@ package org.apache.flex.core
          * The properties that enumerate that we skip
          */
         COMPILE::JS
-        public static var skipStyles:Object = {
+        public static const skipStyles:Object = {
             'constructor': 1
         };
         
@@ -748,8 +745,7 @@ package org.apache.flex.core
                     else
                         value = value.toString() + 'px';
                 }
-                else if (p === 'backgroundImage') {
-                    if (p.indexOf('url') !== 0)
+                else if (p === 'backgroundImage' && p.indexOf('url') !== 0) {
                         value = 'url(' + value + ')';
                 }
                 (thisObject.element as HTMLElement).style[p] = value;


[08/10] git commit: [flex-asjs] [refs/heads/develop] - Add INHERIT rather than have it defined as a text string in a dozen places

Posted by jm...@apache.org.
Add INHERIT rather than have it defined as a text string in a dozen places


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

Branch: refs/heads/develop
Commit: 5dd19ccafc41f65b4876aee4cd53f1d46dbe8375
Parents: 43dab1d
Author: Justin Mclean <jm...@apache.org>
Authored: Sun May 21 07:57:02 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun May 21 07:57:02 2017 +1000

----------------------------------------------------------------------
 .../org/apache/flex/core/SimpleCSSValuesImpl.as  | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5dd19cca/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index d797172..3668b9c 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -48,6 +48,9 @@ package org.apache.flex.core
      */
 	public class SimpleCSSValuesImpl extends EventDispatcher implements IValuesImpl, ICSSImpl
 	{
+
+        private static const INHERIT:String = "inherit";
+
         /**
          *  Constructor.
          *  
@@ -343,7 +346,7 @@ package org.apache.flex.core
                     catch (e:Error) {
                         value = undefined;
                     }
-                    if (value === "inherit")
+                    if (value === INHERIT)
                         return getInheritingValue(thisObject, valueName, state, attrs);
                     if (value !== undefined)
                         return value;
@@ -354,7 +357,7 @@ package org.apache.flex.core
                     if (o)
                     {
                         value = o[valueName];
-                        if (value === "inherit")
+                        if (value === INHERIT)
                             return getInheritingValue(thisObject, valueName, state, attrs);
                         if (value !== undefined)
                             return value;
@@ -373,7 +376,7 @@ package org.apache.flex.core
                             if (o)
                             {
                                 value = o[valueName];
-                                if (value === "inherit")
+                                if (value === INHERIT)
                                     return getInheritingValue(thisObject, valueName, state, attrs);
                                 if (value !== undefined)
                                     return value;
@@ -384,7 +387,7 @@ package org.apache.flex.core
                         if (o)
                         {
                             value = o[valueName];
-                            if (value === "inherit")
+                            if (value === INHERIT)
                                 return getInheritingValue(thisObject, valueName, state, attrs);
                             if (value !== undefined)
                                 return value;
@@ -411,7 +414,7 @@ package org.apache.flex.core
 					if (o)
 					{
 						value = o[valueName];
-                        if (value === "inherit")
+                        if (value === INHERIT)
                             return getInheritingValue(thisObject, valueName, state, attrs);
 						if (value !== undefined)
 							return value;
@@ -422,7 +425,7 @@ package org.apache.flex.core
 	            if (o)
 	            {
 	                value = o[valueName];
-                    if (value === "inherit")
+                    if (value === INHERIT)
                         return getInheritingValue(thisObject, valueName, state, attrs);
 	                if (value !== undefined)
 	                    return value;
@@ -475,14 +478,14 @@ package org.apache.flex.core
                 if (parentObject)
                 {
                     value = getValue(parentObject, valueName, state, attrs);
-                    if (value === "inherit" || value === undefined)
+                    if (value === INHERIT || value === undefined)
                         return getInheritingValue(parentObject, valueName, state, attrs);
                     if (value !== undefined)
                         return value;
                 }
                 return undefined;
             }
-            return "inherit";
+            return INHERIT;
         }
         
         /**


[03/10] flex-asjs git commit: mainClass parameter was hiding mainClass property and uncovered a bug were mainClass wasn’t being set on the JS side but being used in getInstance

Posted by jm...@apache.org.
mainClass parameter was hiding mainClass property and uncovered a bug were mainClass wasn’t being set on the JS side but being used in getInstance


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

Branch: refs/heads/develop
Commit: 1ec54127741317a9a0506d674d9cfde5c2a18a05
Parents: 004d204
Author: Justin Mclean <jm...@apache.org>
Authored: Sun May 21 07:03:00 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun May 21 07:03:00 2017 +1000

----------------------------------------------------------------------
 .../flex/org/apache/flex/core/SimpleCSSValuesImpl.as     | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1ec54127/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index 391d54d..dd8b88a 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -74,14 +74,14 @@ package org.apache.flex.core
          *  @productversion FlexJS 0.0
          */
         COMPILE::SWF
-        public function init(mainClass:Object):void
+        public function init(main:Object):void
         {
 			var styleClassName:String;
 			var c:Class;
 			if (!values)
 			{
 				values = {};
-	            this.mainClass = mainClass;
+	            this.mainClass = main;
 	            var mainClassName:String = getQualifiedClassName(mainClass);
 				styleClassName = "_" + mainClassName + "_Styles";
 				c = ApplicationDomain.currentDomain.getDefinition(styleClassName) as Class;
@@ -107,10 +107,13 @@ package org.apache.flex.core
         }
         
         COMPILE::JS
-        public function init(mainClass:Object):void
+        public function init(main:Object):void
         {
-            var cssData:Array = mainClass.cssData;
+            var cssData:Array = main.cssData;
             var values:Object = this.values;
+
+            this.mainClass = main;
+
             if (values == null)
                 values = {};
             


[10/10] git commit: [flex-asjs] [refs/heads/develop] - remove unnamed if check

Posted by jm...@apache.org.
remove unnamed if check


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

Branch: refs/heads/develop
Commit: a3d6ae413d6449bdbfe765ba37af657cb350b71c
Parents: 60f614a
Author: Justin Mclean <jm...@apache.org>
Authored: Sun May 21 09:46:52 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun May 21 09:46:52 2017 +1000

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a3d6ae41/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index d854ca4..70c597a 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -478,10 +478,10 @@ package org.apache.flex.core
                 if (parentObject)
                 {
                     value = getValue(parentObject, valueName, state, attrs);
-                    if (value === INHERIT || value === undefined)
+                    if (value === INHERIT || value === undefined) {
                         return getInheritingValue(parentObject, valueName, state, attrs);
-                    if (value !== undefined)
-                        return value;
+                    }
+                    return value;
                 }
                 return undefined;
             }


[05/10] git commit: [flex-asjs] [refs/heads/develop] - this is not a real loop as the loop counter is being modified

Posted by jm...@apache.org.
this is not a real loop as the loop counter is being modified


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

Branch: refs/heads/develop
Commit: efd7ec08faf842a335ca0d00c0f7dc13913797f8
Parents: 8172e19
Author: Justin Mclean <jm...@apache.org>
Authored: Sun May 21 07:33:06 2017 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Sun May 21 07:33:06 2017 +1000

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/efd7ec08/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
index 45b3779..2b0c124 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -169,7 +169,7 @@ package org.apache.flex.core
             var declarationName:String = "";
             var segmentName:String = "";
             var n:int = arr.length;
-            for (var i:int = 0; i < n; i++)
+            while (i < n)
             {
                 var className:int = arr[i];
                 if (className === CSSClass.CSSSelector)
@@ -254,6 +254,7 @@ package org.apache.flex.core
                     }
                     declarationName = "";
                 }
+                i++;
             }
             
         }