-Fixed documentation typo

-Fixed error when serializing some interfaces with hidden properties
-Fixed some large integers being incorrectly read from JSON
This commit is contained in:
James Newton-King
2015-08-30 22:24:57 +12:00
parent 375ec02996
commit 85e7968ed9
9 changed files with 343 additions and 7 deletions
@@ -665,6 +665,21 @@ namespace Newtonsoft.Json.Utilities
int end = start + length;
// Int32.MaxValue and MinValue are 10 chars
if (length > 10)
{
// invalid result takes precedence over overflow
for (int i = start; i < end; i++)
{
int c = chars[i] - '0';
if (c < 0 || c > 9)
return ParseResult.Invalid;
}
return ParseResult.Overflow;
}
for (int i = start; i < end; i++)
{
int c = chars[i] - '0';
@@ -730,6 +745,21 @@ namespace Newtonsoft.Json.Utilities
int end = start + length;
// Int64.MaxValue and MinValue are 19 chars
if (length > 19)
{
// invalid result takes precedence over overflow
for (int i = start; i < end; i++)
{
int c = chars[i] - '0';
if (c < 0 || c > 9)
return ParseResult.Invalid;
}
return ParseResult.Overflow;
}
for (int i = start; i < end; i++)
{
int c = chars[i] - '0';