You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2019/12/16 06:58:54 UTC

[royale-asjs] branch develop updated: Add error trap for function binding.

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

gregdove 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 38f622c  Add error trap for function binding.
     new b165d70  Merge branch 'develop' of https://github.com/apache/royale-asjs into develop
38f622c is described below

commit 38f622cd338bd0b3a8de530b8657058b59b82096
Author: greg-dove <gr...@gmail.com>
AuthorDate: Mon Dec 16 19:57:50 2019 +1300

    Add error trap for function binding.
---
 .../org/apache/royale/binding/PropertyWatcher.as    | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/PropertyWatcher.as b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/PropertyWatcher.as
index 96f3645..ce83062 100644
--- a/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/PropertyWatcher.as
+++ b/frameworks/projects/Binding/src/main/royale/org/apache/royale/binding/PropertyWatcher.as
@@ -243,15 +243,20 @@ package org.apache.royale.binding
                 else
                 {
                     if (funcProps != null) {
-                        if (funcProps.functionGetter != null)
-                        {
-                            value = funcProps.functionGetter(funcProps.functionName).apply(source,
-                                    funcProps.paramFunction.apply(document));
-                        }
-                        else
+                        try{
+                            if (funcProps.functionGetter != null)
+                            {
+                                value = funcProps.functionGetter(funcProps.functionName).apply(source,
+                                        funcProps.paramFunction.apply(document));
+                            }
+                            else
+                            {
+                                value = source[funcProps.functionName].apply(source,
+                                        funcProps.paramFunction.apply(document));
+                            }
+                        } catch (e:Error)
                         {
-                            value = source[funcProps.functionName].apply(source,
-                                    funcProps.paramFunction.apply(document));
+                            value = null;
                         }
                     }
                     else if (getterFunction != null)