Java Javascript Mozilla Library createNativeArray(int length, Scriptable scope)

Here you can find the source of createNativeArray(int length, Scriptable scope)

Description

create Native Array

License

Open Source License

Declaration

static NativeArray createNativeArray(int length, Scriptable scope) 

Method Source Code


//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;
    }
}

Related

  1. convertObject(NativeObject jsObject, Map identities)
  2. copyPropertiesToScriptable(Hashtable properties, Scriptable scriptable)
  3. copyScope(Context context, Scriptable scope)
  4. copyScriptableToProperties(Scriptable scriptable, Map properties)
  5. createJavaAdapterArgs(Scriptable scope, Class[] ifaces, Object jsImpl)
  6. createSecurityController()
  7. ensureValid(Object obj)
  8. enterContext()
  9. evaluateJSExpression(String expr, Context cx, Scriptable scope)