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 2020/04/24 06:55:52 UTC
[royale-asjs] 02/06: Fix for XMLList top level function should
return the original when passed an XMLList instance
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
commit 5f10eb72c26b288cbcaeaa5db2e9f1cd184d83f4
Author: greg-dove <gr...@gmail.com>
AuthorDate: Fri Apr 24 17:49:34 2020 +1200
Fix for XMLList top level function should return the original when passed an XMLList instance
---
frameworks/projects/XML/src/main/royale/XMLList.as | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/frameworks/projects/XML/src/main/royale/XMLList.as b/frameworks/projects/XML/src/main/royale/XMLList.as
index b2f9206..ea88105 100644
--- a/frameworks/projects/XML/src/main/royale/XMLList.as
+++ b/frameworks/projects/XML/src/main/royale/XMLList.as
@@ -34,9 +34,11 @@ package
* mimics the top-level XMLList function (supports 'this' correctly)
*
* @royalesuppressexport
+ * @royaleignorecoercion XMLList
*/
public static function conversion(val:* = null):XMLList{
- return new XMLList(val);
+ if (val && val.constructor == XMLList) return val as XMLList;
+ else return new XMLList(val);
}
public function XMLList(expression:Object = null)