flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [2/3] git commit: [flex-asjs] [refs/heads/develop] - If the view doesn't have cssData (as with the DataGridExample), this prevents an exception.
Date Wed, 13 Nov 2013 13:05:54 GMT
If the view doesn't have cssData (as with the DataGridExample), this prevents an exception.

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


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

Branch: refs/heads/develop
Commit: 56d75ed9dc6ed860436af6750bef114f39d18e21
Parents: 5132d5f
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Wed Nov 13 14:03:59 2013 +0100
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Wed Nov 13 14:03:59 2013 +0100

----------------------------------------------------------------------
 .../org/apache/flex/core/SimpleCSSValuesImpl.js | 86 ++++++++++----------
 1 file changed, 44 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/56d75ed9/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleCSSValuesImpl.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleCSSValuesImpl.js b/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleCSSValuesImpl.js
index 22c362c..48a4318 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleCSSValuesImpl.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleCSSValuesImpl.js
@@ -143,54 +143,56 @@ org.apache.flex.core.SimpleCSSValuesImpl.prototype.init = function(mainclass)
{
   if (values == null)
     values = {};
 
-  var n = cssData.length;
-  var i = 0;
-  while (i < n)
-  {
-    var numMQ = cssData[i++];
-    if (numMQ > 0)
-    {
-      // skip MediaQuery tests for now
-      i += numMQ;
-    }
-    var numSel = cssData[i++];
-    var props = {};
-    for (var j = 0; j < numSel; j++)
+  if (cssData) {
+    var n = cssData.length;
+    var i = 0;
+    while (i < n)
     {
-      var selName = cssData[i++];
-      if (selName.indexOf('.') != 0 &&
-          selName != '*' && selName != 'global')
+      var numMQ = cssData[i++];
+      if (numMQ > 0)
       {
-        // should be a type selector
-        var parts = selName.split('.');
-        var numParts = parts.length;
-        var part = window;
-        for (var k = 0; k < numParts; k++)
+        // skip MediaQuery tests for now
+        i += numMQ;
+      }
+      var numSel = cssData[i++];
+      var props = {};
+      for (var j = 0; j < numSel; j++)
+      {
+        var selName = cssData[i++];
+        if (selName.indexOf('.') != 0 &&
+            selName != '*' && selName != 'global')
         {
-          var partName = parts[k];
-          var subpart = part[partName];
-          if (subpart == undefined)
-            break;
-          // assume last part is ctor func
-          if (k == numParts - 1)
-            subpart = subpart.prototype;
-          subpart.__css__package_parent = part;
-          subpart.__css__name = partName;
-          part = subpart;
+          // should be a type selector
+          var parts = selName.split('.');
+          var numParts = parts.length;
+          var part = window;
+          for (var k = 0; k < numParts; k++)
+          {
+            var partName = parts[k];
+            var subpart = part[partName];
+            if (subpart == undefined)
+              break;
+            // assume last part is ctor func
+            if (k == numParts - 1)
+              subpart = subpart.prototype;
+            subpart.__css__package_parent = part;
+            subpart.__css__name = partName;
+            part = subpart;
+          }
         }
+        if (values[selName])
+          props = values[selName];
+        values[selName] = props;
+      }
+      var numProps = cssData[i++];
+      for (j = 0; j < numProps; j++)
+      {
+        var propName = cssData[i++];
+        var propValue = cssData[i++];
+        props[propName] = propValue;
       }
-      if (values[selName])
-        props = values[selName];
-      values[selName] = props;
-    }
-    var numProps = cssData[i++];
-    for (j = 0; j < numProps; j++)
-    {
-      var propName = cssData[i++];
-      var propValue = cssData[i++];
-      props[propName] = propValue;
     }
   }
+
   this.values = values;
 };
-


Mime
View raw message