fix bug in states destination handling

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

Branch: refs/heads/develop
Commit: f398dca204bde8abeb75645ad4e15a239be5125c
Parents: 695c21c
Author: Alex Harui <aha...@apache.org>
Authored: Thu Mar 20 13:25:23 2014 -0700
Committer: Alex Harui <aha...@apache.org>
Committed: Thu Mar 20 13:27:09 2014 -0700

----------------------------------------------------------------------
 .../FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js  | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f398dca2/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js 
b/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
index 318f65a..f524bc0 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/SimpleStatesImpl.js
@@ -169,10 +169,13 @@ org.apache.flex.core.SimpleStatesImpl.prototype.apply_ = 
function(s) {
       for (q in o.items) {
         item = o.items[q];
 
-        if (typeof(o.document['get_' + o.destination]) === 'function') {
-          parent = o.document['get_' + o.destination]();
-        } else {
-          parent = o.document[o.destination];
+        parent = o.document;
+        if (o.destination) {
+          if (typeof(o.document['get_' + o.destination]) === 'function') {
+            parent = o.document['get_' + o.destination]();
+          } else {
+            parent = o.document[o.destination];
+          }
         }
 
         if (o.relativeTo) {

Reply via email to