XMLLIst needed name() for single item lists
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d4dc652c Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d4dc652c Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d4dc652c Branch: refs/heads/feature/maven-migration Commit: d4dc652c9231ba1707a619b60e8fd891f3d728a2 Parents: 60670ec Author: Harbs <[email protected]> Authored: Mon Apr 11 13:36:20 2016 +0300 Committer: Harbs <[email protected]> Committed: Mon Apr 11 13:36:20 2016 +0300 ---------------------------------------------------------------------- frameworks/projects/XML/src/main/flex/XMLList.as | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4dc652c/frameworks/projects/XML/src/main/flex/XMLList.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/XML/src/main/flex/XMLList.as b/frameworks/projects/XML/src/main/flex/XMLList.as index cb38a4b..d507033 100644 --- a/frameworks/projects/XML/src/main/flex/XMLList.as +++ b/frameworks/projects/XML/src/main/flex/XMLList.as @@ -437,6 +437,13 @@ package return _xmlArray.length; } + COMPILE::JS + public function name():QName + { + if(_xmlArray.length == 1) + return _xmlArray[0].name(); + return null; + } /** * Merges adjacent text nodes and eliminates empty text nodes for each of the following: * all text nodes in the XMLList, all the XML objects contained in the XMLList, and the descendants of all the XML objects in the XMLList.
