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

harbs 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 f51e413  Added comment to explain why closure works the way it does.
f51e413 is described below

commit f51e413d46a38f740a72f70510384cd5eddee66a
Author: Harbs <[email protected]>
AuthorDate: Wed Jan 5 19:42:32 2022 +0200

    Added comment to explain why closure works the way it does.
---
 .../Language/src/main/royale/org/apache/royale/utils/Language.as    | 6 ++++++
 1 file changed, 6 insertions(+)

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 7da7055..19773c7 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
@@ -328,6 +328,12 @@ package org.apache.royale.utils
         
         /**
          * caches closures and returns the one closure
+         * 
+         * Note: It's important for each instance's methods to be different,
+         * but match when comparing two closure references of a single 
instance method
+         * to one another. That's what makes things like addEventListener and
+         * removeEventListener behave like you'd expect. That's how it works 
in Flash
+         * and why we have to using caching.
          *
          * @param fn The method on the instance.
          * @param object The instance.

Reply via email to