flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gregd...@apache.org
Subject [3/4] git commit: [flex-asjs] [refs/heads/develop] - Added guard to swf for getValue when requested field is not a member of the typed storage class
Date Thu, 08 Jun 2017 22:22:21 GMT
Added guard to swf for getValue when requested field is not a member of the typed storage class


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

Branch: refs/heads/develop
Commit: 1af9cc8f000f8059d178627cdd35e94d68a5892a
Parents: 08af60c
Author: greg-dove <greg.dove@gmail.com>
Authored: Fri Jun 9 10:09:17 2017 +1200
Committer: greg-dove <greg.dove@gmail.com>
Committed: Fri Jun 9 10:18:39 2017 +1200

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


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1af9cc8f/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 5e3a6c4..b63db1a 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
@@ -339,7 +339,19 @@ package org.apache.flex.core
                 // undefined in JS null in AS
                 if (styleable.style != null)
                 {
-                    value = styleable.style[valueName];
+                    COMPILE::SWF
+                    {
+                        // guard to check for field avoiding need for try/catch
+                        if (valueName in styleable.style) {
+                            value = styleable.style[valueName];
+                        }
+                    }
+                    COMPILE::JS
+                    {
+                        //sets to undefined if not present
+                        value = styleable.style[valueName];
+                    }
+
                     if (value === INHERIT)
                         return getInheritingValue(thisObject, valueName, state, attrs);
                     if (value !== undefined)


Mime
View raw message