[
https://issues.apache.org/jira/browse/SLING-3413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13911151#comment-13911151
]
Justin Edelson commented on SLING-3413:
---------------------------------------
bq. Sounds reasonable, except for *list*Children returning a Map; maybe another
name makes more sense ?
Yeah, I'm on the fence. Let's call the patch a strawman for now. I'll take it
to the list.
bq. Also not sure about the dual-nature of the listChildren method (this might
be customary in JS, with my Java hat on it looks strange).
I think it is fairly customary in JS to have an optional function argument
which changes the behavior. Take a look, for example, at `get()` in
http://dev.day.com/docs/en/cq/current/widgets-api/?class=CQ.HTTP. But maybe
this is too clever and simply calling the function-taking method `eachChild()`
would be better.
bq. Can the function given to listChildren cause the "loop" to terminate early ?
If it threw an exception...
> add support for getName() and listChildren() to JS Resource API
> ---------------------------------------------------------------
>
> Key: SLING-3413
> URL: https://issues.apache.org/jira/browse/SLING-3413
> Project: Sling
> Issue Type: Improvement
> Components: Scripting
> Reporter: Justin Edelson
> Fix For: Scripting JavaScript 2.0.14
>
>
> The JS API used to wrap Resources doesn't support getting a list of children
> or the resource's name. This should be added.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)