diff --git a/src/helma/scripting/rhino/HopObject.java b/src/helma/scripting/rhino/HopObject.java index d1a11cc8..3dfcd542 100644 --- a/src/helma/scripting/rhino/HopObject.java +++ b/src/helma/scripting/rhino/HopObject.java @@ -452,6 +452,31 @@ public class HopObject extends ScriptableObject implements Wrapper { return Context.getCurrentContext().newArray(core.global, a.toArray()); } + /** + * Return a JS array of child objects with the given start and length. + * + * @return A JavaScript Array containing the specified child objexts + */ + public Scriptable jsFunction_list(int start, int length) { + if (start < 0 || length < 0) { + throw new EvaluatorException("Arguments must not be negative in HopObject.list(start, length)"); + } + + checkNode(); + + jsFunction_prefetchChildren(start, length); + ArrayList a = new ArrayList(); + + for (int i=start; i