Java 类org.mozilla.javascript.ObjArray 实例源码

项目:pizzascript    文件:SourceFile.java   
public static DebuggableScript[] getAllFunctions(DebuggableScript function) {
    ObjArray functions = new ObjArray();
    collectFunctions(function, functions);
    DebuggableScript[] result = new DebuggableScript[functions.size()];
    functions.toArray(result);
    return result;
}
项目:pizzascript    文件:SourceFile.java   
private static void collectFunctions(DebuggableScript function,
                                     ObjArray array) {
    array.add(function);
    for (int i = 0; i != function.getFunctionCount(); ++i) {
        collectFunctions(function.getFunction(i), array);
    }
}