示例#1
0
 public override object Eval()
 {
     try
     {
         object   targetVal = _target.Eval();
         object[] argvals   = new object[_args.Count];
         for (int i = 0; i < _args.Count; i++)
         {
             argvals[i] = _args[i].ArgExpr.Eval();
         }
         if (_method != null)
         {
             return(Reflector.InvokeMethod(_method, targetVal, argvals));
         }
         return(Reflector.CallInstanceMethod(_methodName, _typeArgs, targetVal, argvals));
     }
     catch (Compiler.CompilerException)
     {
         throw;
     }
     catch (Exception e)
     {
         throw new Compiler.CompilerException(_source, Compiler.GetLineFromSpanMap(_spanMap), Compiler.GetColumnFromSpanMap(_spanMap), e);
     }
 }
示例#2
0
        // TODO: Handle by-ref
        public override object Eval()
        {
            object target = _target.Eval();

            return(Reflector.CallInstanceMethod(_memberName, null, target, new object[0]));
        }