You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2019/12/19 12:03:10 UTC

[royale-compiler] branch develop updated: bindings: solves a problem for function bindings where all bindings resolve to the latest one

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

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


The following commit(s) were added to refs/heads/develop by this push:
     new 885c927  bindings:  solves a problem for function bindings where all bindings resolve to the latest one
885c927 is described below

commit 885c927e0c42ca1517e90a3f326a3ff87e6dfc63
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Thu Dec 19 13:02:59 2019 +0100

    bindings:  solves a problem for function bindings where all bindings resolve to the latest one
---
 .../compiler/internal/codegen/databinding/WatcherAnalyzer.java       | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/WatcherAnalyzer.java b/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/WatcherAnalyzer.java
index 4ef1189..7f9289e 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/WatcherAnalyzer.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/codegen/databinding/WatcherAnalyzer.java
@@ -353,6 +353,11 @@ public class WatcherAnalyzer
             eventNames = WatcherInfoBase.getEventNamesFromDefinition(def, problems, node, project);
             name = def.getBaseName();
             id = def;
+            //solves a problem for function bindings where all bindings resolve to the latest one
+            if (type == WatcherType.FUNCTION) {
+                //make sure we have unique watchers for each functionCallNode
+                id = node;//or maybe node.getAncestorOfType(FunctionCallNode.class); ?
+            }
         }
         
         makeWatcherOfKnownType(id, type, state, node, eventNames, name, def);