You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2020/04/10 13:40:56 UTC

[royale-asjs] branch develop updated: Add caching to conditional binding

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

yishayw 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 c264b8c  Add caching to conditional binding
c264b8c is described below

commit c264b8cc8a39a80545d0dfab6735879326359459
Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
AuthorDate: Fri Apr 10 16:40:43 2020 +0300

    Add caching to conditional binding
---
 .../Language/src/main/royale/org/apache/royale/utils/Language.as    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as b/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as
index 1663954..ab0ca81 100644
--- a/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as
+++ b/frameworks/projects/Language/src/main/royale/org/apache/royale/utils/Language.as
@@ -275,14 +275,16 @@ package org.apache.royale.utils
          *
          * @param fn The method on the instance.
          * @param object The instance.
+         * @param boundMethodName The name to use to cache the closure.
          * @return The closure, or null.
          *
+         * @royaleignorecoercion Function
          */
-        static public function conditionalBind(fn:Function, object:Object):Function
+        static public function conditionalClosure(fn:Function, object:Object, boundMethodName:String):Function
         {
             if (fn == null)
                 return null;
-            return goog.bind(fn, object);
+            return Language.closure(fn, object, boundMethodName);
         }
         
         /**