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 <[email protected]> Authored: Fri Jun 9 10:09:17 2017 +1200 Committer: greg-dove <[email protected]> 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)
