-Incremented version to 4.5.3

-Changed default DefaultContractResolver.IgnoreSerializableAttribute to true
-Fixed MaxDepth on JsonReader recursively throwing error
-Fixed SerializationBinder.BindToName not being called with full assembly names
This commit is contained in:
James Newton-King
2012-04-14 00:58:36 +12:00
parent 11310fdf05
commit adecef2126
11 changed files with 151 additions and 9 deletions
+8 -1
View File
@@ -110,6 +110,7 @@ namespace Newtonsoft.Json
private CultureInfo _culture;
private DateTimeZoneHandling _dateTimeZoneHandling;
private int? _maxDepth;
private bool _hasExceededMaxDepth;
/// <summary>
/// Gets the current reader state.
@@ -258,8 +259,11 @@ namespace Newtonsoft.Json
_currentPosition = state;
// this is a little hacky because Depth increases when first property/value is written but only testing here is faster/simpler
if (_maxDepth != null && Depth + 1 > _maxDepth)
if (_maxDepth != null && Depth + 1 > _maxDepth && !_hasExceededMaxDepth)
{
_hasExceededMaxDepth = true;
throw CreateReaderException(this, "The reader's MaxDepth of {0} has been exceeded.".FormatWith(CultureInfo.InvariantCulture, _maxDepth));
}
}
}
@@ -278,6 +282,9 @@ namespace Newtonsoft.Json
_currentPosition = new JsonPosition();
}
if (_maxDepth != null && Depth <= _maxDepth)
_hasExceededMaxDepth = false;
return oldPosition.Type;
}