get binding working again

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

Branch: refs/heads/refactor-sprite
Commit: 33363618f1ba692e42fd55e826519835b1805438
Parents: a42e69e
Author: Alex Harui <aha...@apache.org>
Authored: Fri Oct 7 22:09:29 2016 -0700
Committer: Alex Harui <aha...@apache.org>
Committed: Fri Oct 7 22:09:41 2016 -0700

----------------------------------------------------------------------
 .../apache/flex/binding/ApplicationDataBinding.as   |  8 ++++----
 .../org/apache/flex/binding/ContainerDataBinding.as |  8 ++++----
 .../apache/flex/binding/MXMLBeadViewDataBinding.as  |  8 ++++----
 .../flex/org/apache/flex/binding/PropertyWatcher.as | 16 +++++++++++++---
 .../flex/org/apache/flex/binding/ViewDataBinding.as |  4 ++--
 5 files changed, 27 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/33363618/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ApplicationDataBinding.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ApplicationDataBinding.as
 
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ApplicationDataBinding.as
index c8a501f..e4130c9 100644
--- 
a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ApplicationDataBinding.as
+++ 
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ApplicationDataBinding.as
@@ -235,10 +235,10 @@ package org.apache.flex.binding
                     {
                         case "property":
                         {
-                            var pw:PropertyWatcher = new PropertyWatcher(this, 
-                                        watcher.propertyName, 
-                                        watcher.eventNames,
-                                        (typeof(gb.source) === "function") ? 
gb.source as Function : watcher.getterFunction);
+                            var pw:PropertyWatcher = new 
PropertyWatcher(_strand, 
+                                watcher.propertyName, 
+                                watcher.eventNames,
+                                (typeof(gb.source) === "function" && 
watcher.children == null) ? gb.source as Function : watcher.getterFunction);
                             watcher.watcher = pw;
                             if (parentWatcher)
                                 pw.parentChanged(parentWatcher.value);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/33363618/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ContainerDataBinding.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ContainerDataBinding.as
 
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ContainerDataBinding.as
index 5deb680..1a0fdfb 100644
--- 
a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ContainerDataBinding.as
+++ 
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ContainerDataBinding.as
@@ -281,10 +281,10 @@ package org.apache.flex.binding
                     {
                         case "property":
                         {
-                            var pw:PropertyWatcher = new PropertyWatcher(this, 
-                                        watcher.propertyName, 
-                                        watcher.eventNames,
-                                        (typeof(gb.source) === "function") ? 
gb.source as Function : watcher.getterFunction);
+                            var pw:PropertyWatcher = new 
PropertyWatcher(_strand, 
+                                watcher.propertyName, 
+                                watcher.eventNames,
+                                (typeof(gb.source) === "function" && 
watcher.children == null) ? gb.source as Function : watcher.getterFunction);
                             watcher.watcher = pw;
                             if (parentWatcher)
                                 pw.parentChanged(parentWatcher.value);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/33363618/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/MXMLBeadViewDataBinding.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/MXMLBeadViewDataBinding.as
 
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/MXMLBeadViewDataBinding.as
index 043e10f..0579ace 100644
--- 
a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/MXMLBeadViewDataBinding.as
+++ 
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/MXMLBeadViewDataBinding.as
@@ -230,10 +230,10 @@ package org.apache.flex.binding
                     {
                         case "property":
                         {
-                            var pw:PropertyWatcher = new PropertyWatcher(this, 
-                                        watcher.propertyName, 
-                                        watcher.eventNames,
-                                        (typeof(gb.source) === "function") ? 
gb.source as Function : watcher.getterFunction);
+                            var pw:PropertyWatcher = new 
PropertyWatcher(_strand, 
+                                watcher.propertyName, 
+                                watcher.eventNames,
+                                (typeof(gb.source) === "function" && 
watcher.children == null) ? gb.source as Function : watcher.getterFunction);
                             watcher.watcher = pw;
                             if (parentWatcher)
                                 pw.parentChanged(parentWatcher.value);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/33363618/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/PropertyWatcher.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/PropertyWatcher.as
 
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/PropertyWatcher.as
index 98015dc..1ea83ef 100644
--- 
a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/PropertyWatcher.as
+++ 
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/PropertyWatcher.as
@@ -48,10 +48,10 @@ package org.apache.flex.binding
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.0
          */
-               public function PropertyWatcher(source:Object, 
propertyName:String, eventNames:Object, 
+               public function PropertyWatcher(document:Object, 
propertyName:String, eventNames:Object, 
                                             getterFunction:Function)
                {
-            this.source = source;
+            this.document = document;
             this.propertyName = propertyName;
             this.getterFunction = getterFunction;
             this.eventNames = eventNames;
@@ -71,6 +71,16 @@ package org.apache.flex.binding
         protected var dispatcher:IEventDispatcher;
                
         /**
+         *  The document we belong to.
+         *
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public var document:Object;
+        
+        /**
          *  The object who's property we are watching.
          *
          *  @langversion 3.0
@@ -226,7 +236,7 @@ package org.apache.flex.binding
                 {
                     if (getterFunction != null)
                     {
-                        value = getterFunction.apply(source, [ propertyName ]);
+                        value = getterFunction.apply(document, [ propertyName 
]);
                     }
                     else
                     {

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/33363618/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ViewDataBinding.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ViewDataBinding.as
 
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ViewDataBinding.as
index d9cdfd2..44c5489 100644
--- 
a/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ViewDataBinding.as
+++ 
b/frameworks/projects/Binding/src/main/flex/org/apache/flex/binding/ViewDataBinding.as
@@ -266,10 +266,10 @@ package org.apache.flex.binding
                             gb.isStatic = true;
                         case "property":
                         {
-                            var pw:PropertyWatcher = new PropertyWatcher(this, 
+                            var pw:PropertyWatcher = new 
PropertyWatcher(_strand, 
                                         watcher.propertyName, 
                                         watcher.eventNames,
-                                        (typeof(gb.source) === "function") ? 
gb.source as Function : watcher.getterFunction);
+                                        (typeof(gb.source) === "function" && 
watcher.children == null) ? gb.source as Function : watcher.getterFunction);
                             watcher.watcher = pw;
                             if (parentWatcher)
                                 pw.parentChanged(parentWatcher.value);

Reply via email to