Handles passing objects back and forth between the .NET and Jurassic environments. Cannot be reused across script engines.
示例#1
0
        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);
        }
示例#2
0
 public UnwrappedArray(Marshaler marshaler, ArrayInstance array)
 {
     this.marshaler = marshaler;
     this.array     = array;
 }
示例#3
0
 public WrappedFunction(Marshaler marshaler, ScriptEngine engine, Delegate impl)
     : base(engine, engine.Object.InstancePrototype)
 {
     this.marshaler = marshaler;
     this.impl      = impl;
 }
示例#4
0
文件: Marshaler.cs 项目: vc3/ExoWeb
 public WrappedFunction(Marshaler marshaler, ScriptEngine engine, Delegate impl)
     : base(engine, engine.Object.InstancePrototype)
 {
     this.marshaler = marshaler;
     this.impl = impl;
 }
示例#5
0
文件: Marshaler.cs 项目: vc3/ExoWeb
 public UnwrappedArray(Marshaler marshaler, ArrayInstance array)
 {
     this.marshaler = marshaler;
     this.array = array;
 }