This commit is contained in:
James Newton-King
2014-06-14 19:20:09 +12:00
parent 78d0641f37
commit 20eef9b608
2 changed files with 13 additions and 6 deletions
+3 -4
View File
@@ -56,8 +56,7 @@ namespace Newtonsoft.Json
public class JsonTextReader : JsonReader, IJsonLineInfo
{
private const char UnicodeReplacementChar = '\uFFFD';
private const int MaximumJavascriptIntegerLengthInCharacters = 380;
private const int MaximumJavascriptIntegerCharacterLength = 380;
private readonly TextReader _reader;
private char[] _chars;
@@ -1270,10 +1269,10 @@ namespace Newtonsoft.Json
{
#if !(NET20 || NET35 || PORTABLE40 || PORTABLE)
string number = _stringReference.ToString();
if (number.Length > MaximumJavascriptIntegerLengthInCharacters)
if (number.Length > MaximumJavascriptIntegerCharacterLength)
throw JsonReaderException.Create(this, "JSON integer {0} is too large to parse.".FormatWith(CultureInfo.InvariantCulture, _stringReference.ToString()));
numberValue = BigInteger.Parse(number, CultureInfo.InvariantCulture);
numberType = JsonToken.Integer;
#else