Java Javascript Mozilla Library enterContext()

Here you can find the source of enterContext()

Description

Associate a context with the current thread.

License

Open Source License

Return

a Context associated with the thread

Declaration

public static Context enterContext() 

Method Source Code

//package com.java2s;
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
 * (c) 2001 - 2013 OpenPlans/*from  w  w  w.  j a  v a 2  s  .  com*/
 * This code is licensed under the GPL 2.0 license, available at the root
 * application directory.
 */

import org.mozilla.javascript.Context;

public class Main {
    /**
     * Associate a context with the current thread.  This calls Context.enter()
     * and sets the language version to 1.8.
     * @return a Context associated with the thread
     */
    public static Context enterContext() {
        Context cx = Context.enter();
        cx.setLanguageVersion(Context.VERSION_1_8);
        return cx;
    }
}

Related

  1. copyScriptableToProperties(Scriptable scriptable, Map properties)
  2. createJavaAdapterArgs(Scriptable scope, Class[] ifaces, Object jsImpl)
  3. createNativeArray(int length, Scriptable scope)
  4. createSecurityController()
  5. ensureValid(Object obj)
  6. evaluateJSExpression(String expr, Context cx, Scriptable scope)
  7. from(Scriptable scriptable)
  8. functionArg(Object[] args, int pos, boolean required)
  9. getArray(Scriptable scope, NativeArray array)