示例#1
0
        public unsafe Rooted <Value> InvokeFunction(
            JSContextPtr context,
            JSHandleObject thisReference,
            params Value[] arguments
            )
        {
            fixed(Value *pThis = &this)
            fixed(Value * pArgs = arguments)
            {
                var argsPtr    = new ValueArrayPtr((uint)arguments.Length, (IntPtr)pArgs);
                var resultRoot = new Rooted <Value>(context, Undefined);

                if (JSAPI.CallFunctionValue(
                        context, thisReference,
                        pThis,
                        ref argsPtr,
                        resultRoot
                        ))
                {
                    return(resultRoot);
                }

                resultRoot.Dispose();
                return(null);
            }
        }
示例#2
0
        public void Dispose()
        {
            if (LazyRetainedObjects != null)
            {
                foreach (var disposable in LazyRetainedObjects)
                {
                    disposable.Dispose();
                }

                LazyRetainedObjects.Clear();
            }

            Root.Dispose();
        }
示例#3
0
        public Rooted <JS.Value> Evaluate(JSHandleObject scope, string scriptSource, string filename = null, uint lineNumber = 0)
        {
            var resultRoot = new Rooted <JS.Value>(this, JS.Value.Undefined);

            if (JSAPI.EvaluateScript(
                    this, scope,
                    scriptSource, filename, lineNumber,
                    resultRoot
                    ))
            {
                return(resultRoot);
            }

            resultRoot.Dispose();
            return(null);
        }
示例#4
0
 public void Dispose()
 {
     Root.Dispose();
 }