Beispiel #1
0
        // 传参调用, 如果此函数已携带js参数, js参数排在invoke参数后
        public void Invoke(object arg0)
        {
            var ctx = _context.rawValue;

            this.Push(ctx);
            DuktapeBinding.duk_push_var(ctx, arg0);
            _InternalPCall(ctx, 1);
        }
Beispiel #2
0
        public void Invoke(object arg0, object arg1, object arg2, params object[] args)
        {
            var ctx = _context.rawValue;

            this.Push(ctx);
            DuktapeBinding.duk_push_var(ctx, arg0);
            DuktapeBinding.duk_push_var(ctx, arg1);
            DuktapeBinding.duk_push_var(ctx, arg2);
            var size = args.Length;

            for (var i = 0; i < size; i++)
            {
                DuktapeBinding.duk_push_var(ctx, args[i]);
            }
            _InternalPCall(ctx, size + 3);
        }