Merge pull request #487 from mayerwin/patch-1
[mono.git] / mcs / class / System.Core / System.Linq.Expressions / MethodCallExpression.cs
index 59e4822b7f43e1cb98c877ddff54ba7689d9ec87..7f898689c0a796adb10d6fd09d2bab77d2683f2c 100644 (file)
 using System;
 using System.Collections.ObjectModel;
 using System.Reflection;
+using System.Reflection.Emit;
 
 namespace System.Linq.Expressions {
 
        public sealed class MethodCallExpression : Expression {
 
-               Expression @object;
+               Expression obj;
                MethodInfo method;
                ReadOnlyCollection<Expression> arguments;
 
                public Expression Object {
-                       get { return @object; }
+                       get { return obj; }
                }
 
                public MethodInfo Method {
@@ -49,5 +50,27 @@ namespace System.Linq.Expressions {
                public ReadOnlyCollection<Expression> Arguments {
                        get { return arguments; }
                }
+
+               internal MethodCallExpression (MethodInfo method, ReadOnlyCollection<Expression> arguments)
+                       : base (ExpressionType.Call, method.ReturnType)
+               {
+                       this.method = method;
+                       this.arguments = arguments;
+               }
+
+               internal MethodCallExpression (Expression obj, MethodInfo method, ReadOnlyCollection<Expression> arguments)
+                       : base (ExpressionType.Call, method.ReturnType)
+               {
+                       this.obj = obj;
+                       this.method = method;
+                       this.arguments = arguments;
+               }
+
+#if !FULL_AOT_RUNTIME
+               internal override void Emit (EmitContext ec)
+               {
+                       ec.EmitCall (obj, arguments, method);
+               }
+#endif
        }
 }