-Added JsonReaderException ctor with path, line number, line position
-Added JsonWriterException ctor with path
This commit is contained in:
@@ -47,12 +47,13 @@ namespace Newtonsoft.Json.Utilities
|
||||
|
||||
internal class ReflectionObject
|
||||
{
|
||||
public ObjectConstructor<object> Creator { get; private set; }
|
||||
public IDictionary<string, ReflectionMember> Members { get; private set; }
|
||||
public ObjectConstructor<object> Creator { get; }
|
||||
public IDictionary<string, ReflectionMember> Members { get; }
|
||||
|
||||
public ReflectionObject()
|
||||
private ReflectionObject(ObjectConstructor<object> creator)
|
||||
{
|
||||
Members = new Dictionary<string, ReflectionMember>();
|
||||
Creator = creator;
|
||||
}
|
||||
|
||||
public object GetValue(object target, string member)
|
||||
@@ -79,13 +80,12 @@ namespace Newtonsoft.Json.Utilities
|
||||
|
||||
public static ReflectionObject Create(Type t, MethodBase creator, params string[] memberNames)
|
||||
{
|
||||
ReflectionObject d = new ReflectionObject();
|
||||
|
||||
ReflectionDelegateFactory delegateFactory = JsonTypeReflector.ReflectionDelegateFactory;
|
||||
|
||||
ObjectConstructor<object> creatorConstructor = null;
|
||||
if (creator != null)
|
||||
{
|
||||
d.Creator = delegateFactory.CreateParameterizedConstructor(creator);
|
||||
creatorConstructor = delegateFactory.CreateParameterizedConstructor(creator);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -93,10 +93,12 @@ namespace Newtonsoft.Json.Utilities
|
||||
{
|
||||
Func<object> ctor = delegateFactory.CreateDefaultConstructor<object>(t);
|
||||
|
||||
d.Creator = args => ctor();
|
||||
creatorConstructor = args => ctor();
|
||||
}
|
||||
}
|
||||
|
||||
ReflectionObject d = new ReflectionObject(creatorConstructor);
|
||||
|
||||
foreach (string memberName in memberNames)
|
||||
{
|
||||
MemberInfo[] members = t.GetMember(memberName, BindingFlags.Instance | BindingFlags.Public);
|
||||
|
||||
Reference in New Issue
Block a user