Fixes for require
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Upsilon.Evaluator;
|
||||
|
||||
namespace Upsilon.BaseTypes.UserData
|
||||
{
|
||||
@@ -11,7 +12,17 @@ namespace Upsilon.BaseTypes.UserData
|
||||
public UserDataMethodPart(MethodInfo method)
|
||||
{
|
||||
Method = method;
|
||||
Parameters = method.GetParameters().Select(x => new UserDataMethodParameter(x)).ToArray();
|
||||
var pars = method.GetParameters();
|
||||
var ls = new List<UserDataMethodParameter>();
|
||||
foreach (var parameter in pars)
|
||||
{
|
||||
if (parameter.ParameterType == typeof(Script))
|
||||
continue;
|
||||
if (parameter.ParameterType == typeof(EvaluationScope))
|
||||
continue;
|
||||
ls.Add(new UserDataMethodParameter(parameter));
|
||||
}
|
||||
Parameters = ls.ToArray();
|
||||
}
|
||||
|
||||
public MethodInfo Method { get; }
|
||||
|
||||
Reference in New Issue
Block a user