Here you can find the source of createNativeArray(int length, Scriptable scope)
static NativeArray createNativeArray(int length, Scriptable scope)
//package com.java2s; //License from project: Open Source License import org.mozilla.javascript.NativeArray; import org.mozilla.javascript.ScriptRuntime; import org.mozilla.javascript.Scriptable; public class Main { static NativeArray createNativeArray(int length, Scriptable scope) { NativeArray array = new NativeArray(length); ScriptRuntime.setObjectProtoAndParent(array, scope); return array; }/* w ww. j a v a 2 s . c o m*/ static NativeArray createNativeArray(Object[] javaArray, Scriptable scope) { NativeArray array = new NativeArray(javaArray); ScriptRuntime.setObjectProtoAndParent(array, scope); return array; } }