private void EmitOnDemandFunction(ExpressionElement[] elements, FleeILGenerator ilg, IServiceProvider services) { // Load the variable collection EmitLoadVariables(ilg); // Load the function name ilg.Emit(OpCodes.Ldstr, MyName); // Load the arguments array EmitElementArrayLoad(elements, typeof(object), ilg, services); // Call the function to get the result MethodInfo mi = VariableCollection.GetFunctionInvokeMethod(_myOnDemandFunctionReturnType); this.EmitMethodCall(mi, ilg); }