-Increment version to 4.0.7
-Fixed circular reference error when serializing nullable structs -Fixed JsonReader.ReadAsXXX methods not converting string values
This commit is contained in:
@@ -103,6 +103,7 @@ namespace Newtonsoft.Json
|
||||
internal State _currentState;
|
||||
private JTokenType _currentTypeContext;
|
||||
private bool _serializerInArray;
|
||||
private CultureInfo _culture;
|
||||
|
||||
internal void SetSerializeInArray(bool serializerInArray)
|
||||
{
|
||||
@@ -181,6 +182,15 @@ namespace Newtonsoft.Json
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the culture used when reading JSON. Defaults to <see cref="CultureInfo.InvariantCulture"/>.
|
||||
/// </summary>
|
||||
public CultureInfo Culture
|
||||
{
|
||||
get { return _culture ?? CultureInfo.InvariantCulture; }
|
||||
set { _culture = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="JsonReader"/> class with the specified <see cref="TextReader"/>.
|
||||
/// </summary>
|
||||
@@ -473,7 +483,7 @@ namespace Newtonsoft.Json
|
||||
|
||||
int lineNumber;
|
||||
int linePosition;
|
||||
if (lineInfo != null)
|
||||
if (lineInfo != null && lineInfo.HasLineInfo())
|
||||
{
|
||||
lineNumber = lineInfo.LineNumber;
|
||||
linePosition = lineInfo.LinePosition;
|
||||
@@ -492,7 +502,7 @@ namespace Newtonsoft.Json
|
||||
if (!message.EndsWith("."))
|
||||
message += ".";
|
||||
|
||||
if (lineInfo != null)
|
||||
if (lineInfo != null && lineInfo.HasLineInfo())
|
||||
message += " Line {0}, position {1}.".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);
|
||||
|
||||
return message;
|
||||
|
||||
Reference in New Issue
Block a user