-Changed LINQ to JSON load methods to support reading past preceding comments

This commit is contained in:
James Newton-King
2012-07-16 00:01:40 +12:00
parent 55a09d2f73
commit 5d83daa804
8 changed files with 38 additions and 3 deletions
+5
View File
@@ -187,6 +187,11 @@ namespace Newtonsoft.Json.Linq
throw JsonReaderException.Create(reader, "Error reading JConstructor from JsonReader.");
}
while (reader.TokenType == JsonToken.Comment)
{
reader.Read();
}
if (reader.TokenType != JsonToken.StartConstructor)
throw JsonReaderException.Create(reader, "Error reading JConstructor from JsonReader. Current JsonReader item is not a constructor: {0}".FormatWith(CultureInfo.InvariantCulture, reader.TokenType));