internal static CallSiteBinder GetFunctionCallBinder(string name, int argsCount = 0, bool isStatic = true) { return Binder.InvokeMember(CSharpBinderFlags.None, name, null, typeof(object), new[] { isStatic ? CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.IsStaticType, null) : CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) } .Concat(GetArgInfo(argsCount))); }
private static CallSiteBinder GetFunctionCallBinder(IList <ParseNode> nodes, int argCount, bool isStatic) { var funcText = nodes[0].Token.Text; Debug.Assert(funcText.Length >= 2 && funcText.EndsWith("(")); var funcName = funcText.Substring(0, funcText.Length - 1); if (isStatic) { funcName = funcName.ToUpperInvariant(); } return(DLRUtil.GetFunctionCallBinder(funcName, argCount, isStatic)); }