This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 7f3d72a  special case xmlwatcher child of xml var.  Partial fix for 
#819 along with royale-compiler change
7f3d72a is described below

commit 7f3d72a9f90871f7c4f6c9586f4cfd37d6f987e9
Author: Alex Harui <[email protected]>
AuthorDate: Sat May 9 14:32:51 2020 -0700

    special case xmlwatcher child of xml var.  Partial fix for #819 along with 
royale-compiler change
---
 .../src/main/royale/org/apache/royale/binding/DataBindingBase.as   | 7 ++++++-
 .../src/main/royale/org/apache/royale/binding/WatcherBase.as       | 5 +++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git 
a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/DataBindingBase.as
 
b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/DataBindingBase.as
index 83967d8..e7c3f5b 100644
--- 
a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/DataBindingBase.as
+++ 
b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/DataBindingBase.as
@@ -210,7 +210,7 @@ package org.apache.royale.binding
                         {
                             parentWatcher.addChild(pw);
                         }
-                        if (!hasWatcherChildren)
+                        if (!hasWatcherChildren || watcherChildIsXML(watcher))
                         {
                             pw.addBinding(gb);
                         }
@@ -238,6 +238,11 @@ package org.apache.royale.binding
             }
         }
 
+               private function watcherChildIsXML(watcher:Object):Boolean
+               {       
+                       return (watcher.children.watchers.length == 1 && 
watcher.children.watchers[0].type == "xml");
+               }
+
         protected function decodeWatcher(bindingData:Array):Object
         {
             var watcherMap:Object = {};
diff --git 
a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/WatcherBase.as
 
b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/WatcherBase.as
index 9e83e83..8c7edba 100644
--- 
a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/WatcherBase.as
+++ 
b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/WatcherBase.as
@@ -156,7 +156,7 @@ package org.apache.royale.binding
             else
                 listeners.push(binding);
             
-            binding.valueChanged(value, false);
+            binding.valueChanged(value, typeof binding.source === "function");
         }
                 
         /**
@@ -333,7 +333,8 @@ package org.apache.royale.binding
                 
                 for (var i:int = 0; i < n; i++)
                 {
-                    listeners[i].valueChanged(value, false);
+                    var gb:GenericBinding = listeners[i] as GenericBinding;
+                    gb.valueChanged(value, typeof gb.source === "function");
                 }
             }
         }

Reply via email to