Exemple #1
0
        private IValue InvokeMethod(List <IValue> arguments, Scope s)
        {
            NetObject      netObj     = (NetObject)arguments[0];
            ListNode       listNode   = (ListNode)arguments[1];
            IdentifierNode name       = (IdentifierNode)listNode.Children[1];
            var            parameters = listNode.Children.Skip(2).Select(c => c.Eval(s)).ToArray();

            if (parameters.Any())
            {
                return(netObj.Call(name.Name, parameters));
            }
            return(netObj.Call(name.Name));
        }
Exemple #2
0
        public void NetObject_Call_NoArguments()
        {
            var ok = new FieldClass {
                Ok = "some string"
            };
            var netObj = new NetObject(ok);

            var actual   = netObj.Call("Method");
            var expected = ok.Method();

            Assert.AreEqual(expected, actual.ToObject());
        }