Class JsEngine

java.lang.Object
com.intuit.karate.graal.JsEngine

public class JsEngine extends Object
Author:
pthomas3
  • Field Details

    • context

      public final org.graalvm.polyglot.Context context
    • bindings

      public final org.graalvm.polyglot.Value bindings
  • Method Details

    • evalGlobal

      public static JsValue evalGlobal(String src)
    • evalGlobal

      public static JsValue evalGlobal(InputStream is)
    • global

      public static JsEngine global()
    • remove

      public static void remove()
    • local

      public static JsEngine local()
    • copy

      public JsEngine copy()
    • attach

      public org.graalvm.polyglot.Value attach(org.graalvm.polyglot.Value value)
    • attachAll

      public Object attachAll(Object o)
    • eval

      public JsValue eval(InputStream is)
    • eval

      public JsValue eval(File file)
    • eval

      public JsValue eval(String exp)
    • evalForValue

      public org.graalvm.polyglot.Value evalForValue(String exp)
    • put

      public void put(String key, Object value)
    • remove

      public void remove(String key)
    • putAll

      public void putAll(Map<String,Object> map)
    • get

      public JsValue get(String key)
    • execute

      public static Object execute(org.graalvm.polyglot.proxy.ProxyExecutable function, Object... args)
    • execute

      public static org.graalvm.polyglot.Value execute(org.graalvm.polyglot.Value function, Object... args)
    • evalWith

      public org.graalvm.polyglot.Value evalWith(org.graalvm.polyglot.Value value, String src, boolean returnValue)
    • evalWith

      public org.graalvm.polyglot.Value evalWith(Map<String,Object> variables, String src, boolean returnValue)
    • evalWith

      public org.graalvm.polyglot.Value evalWith(Set<String> names, Function<String,Object> getVariable, String src, boolean returnValue)
    • fromJsEvalException

      public static KarateException fromJsEvalException(String js, Exception e, String message)
    • toString

      public String toString()
      Overrides:
      toString in class Object