-Added Path to JsonReaderException, JsonSchemaException and ValidationEventArgs

-Fixed Path on JsonValidatingReader
-Fixed path queries over constructors
This commit is contained in:
James Newton-King
2012-02-25 16:44:07 +13:00
parent 0d6ad0b76e
commit fb2a5998bc
14 changed files with 142 additions and 47 deletions
+13
View File
@@ -141,6 +141,7 @@ namespace Newtonsoft.Json.Linq
int index = (int) part;
JArray a = current as JArray;
JConstructor c = current as JConstructor;
if (a != null)
{
@@ -154,6 +155,18 @@ namespace Newtonsoft.Json.Linq
current = a[index];
}
else if (c != null)
{
if (c.Count <= index)
{
if (errorWhenNoMatch)
throw new IndexOutOfRangeException("Index {0} outside the bounds of JConstructor.".FormatWith(CultureInfo.InvariantCulture, index));
return null;
}
current = c[index];
}
else
{
if (errorWhenNoMatch)