Java Javascript Mozilla Library getArray(Scriptable scope, NativeArray array)

Here you can find the source of getArray(Scriptable scope, NativeArray array)

Description

get Array

License

LGPL

Parameter

Parameter Description
scope a parameter
en a parameter

Declaration

public static Object[] getArray(Scriptable scope, NativeArray array) 

Method Source Code

//package com.java2s;
/*/*from   www . j av  a2  s  .c o  m*/
  ==============================================================================
    
   This file is part of the MOA Lightweight Web Runner
   Copyright 2008 by kRAkEn/gORe's Jucetice Application Development
    
  ------------------------------------------------------------------------------
    
   MOA can be redistributed and/or modified under the terms of the
   GNU Lesser General Public License, as published by the Free Software Foundation;
   version 2 of the License only.
    
   MOA is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
    
   You should have received a copy of the GNU General Public License
   along with MOA; if not, visit www.gnu.org/licenses or write to the
   Free Software Foundation, Inc., 59 Temple Place, Suite 330,
   Boston, MA 02111-1307 USA
    
  ==============================================================================
*/

import org.mozilla.javascript.NativeArray;
import org.mozilla.javascript.Scriptable;

public class Main {
    /**
     * 
     * @param scope
     * @param en
     * @return
     */
    public static Object[] getArray(Scriptable scope, NativeArray array) {
        Object[] v = new Object[(int) array.getLength()];
        for (int i = 0; i < v.length; i++)
            v[i] = array.get(i, array);
        return v;
    }
}

Related

  1. ensureValid(Object obj)
  2. enterContext()
  3. evaluateJSExpression(String expr, Context cx, Scriptable scope)
  4. from(Scriptable scriptable)
  5. functionArg(Object[] args, int pos, boolean required)
  6. getClassOrObjectProto(Scriptable scope, String className)
  7. getDirectColRefExpr(Node refNode, boolean mode)
  8. getFunctionArgsString(FunctionNode fn)
  9. getGlobalContextForValidation()