Esempio n. 1
0
        public override void VisitInvocationExpression(InvocationExpression invocationExpression)
        {
            base.VisitInvocationExpression(invocationExpression);

            var resolve = this.m_Resolver.Resolve(invocationExpression.Target);

            if (resolve is MethodGroupResolveResult)
            {
                var methodResolve = resolve as MethodGroupResolveResult;
                if (!methodResolve.Methods.Any(x => x.Name == methodResolve.MethodName))
                {
                    // FIXME: Extension methods!
                }
                else
                {
                    var method = methodResolve.Methods.First(x => x.Name == methodResolve.MethodName);
                    this.m_Writer.Write(JavaInvoke.DetermineInvocationMethod(method));
                    this.m_Writer.Write(' ');
                    this.m_Writer.WriteLine(JavaSignature.CreateMethodSignature(method));
                }
            }
            else
            {
                throw new NotSupportedException();
            }
        }
Esempio n. 2
0
 public void FunctionInvoke(IMethod method)
 {
     this.m_Writer.Write(JavaInvoke.DetermineInvocationMethod(method));
     this.m_Writer.Write(' ');
     this.m_Writer.WriteLine(JavaSignature.CreateMethodSignature(method));
     if (JavaInvoke.DetermineInvocationMethod(method) != "getstatic")
     {
         this.Pop();
     }
     for (var i = 0; i < method.Parameters.Count; i++)
     {
         this.Pop();
     }
 }