public object Evaluate(IEnumerable<object> arguments, Marshaler marshaler) { ScriptEngine engine = engineFactory.GetScriptEngine(); EnsureCompiled(engine); // call the function object[] wrappedArgs = arguments.Select(marshaler.Wrap).ToArray(); object result; try { result = engine.CallGlobalFunction(functionName, wrappedArgs); } catch(Jurassic.JavaScriptException err) { throw new ScriptFunctionEvaluationException(expression, err); } return marshaler.Unwrap(result); }
public UnwrappedArray(Marshaler marshaler, ArrayInstance array) { this.marshaler = marshaler; this.array = array; }
public WrappedFunction(Marshaler marshaler, ScriptEngine engine, Delegate impl) : base(engine, engine.Object.InstancePrototype) { this.marshaler = marshaler; this.impl = impl; }