- Fix detection of extra characters in JSON input
- Fix detection of invalid negative numeric literals
- Disallow leading zeros
- Use "round-trip" format for floating point numbers
- Serialize NaN and Infinity as strings
- Use NumberFormatInfo.InvariantInfo for Convert.To*()
- Use standard number parsing methods in ReadNumericLiteral()
- Add test cases
Just because the .NET framework does not ship System.Json with their
core profiles does not mean we should not distribuet them.
Bring the joy of System.Json from Silverlight to the desktop
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: ../Makefile
# modified: Makefile
# modified: System.Json.dll.sources
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# ../../../eglib/src/gpath.c.orig
# System.Json/.JsonValue.cs.swp
# sources
# ../System/System.Net/#WebRequest.cs#
# ../../tools/monodoc/Resources/mono-ecma.css.orig
# ../../../mono.h
# ../../../mono/metadata/y
# ../../../mono/mini/.aot-compiler.c.swp
# ../../../mono/utils/mono-dtrace.h
# ../../../monotouch-enterprise.ashx
# ../../../web/
The current loader failed with some Json strings due to the implementation
of the BufferedStreamReader. Removed that implementation completely,
and instead depend on the StreamReader to do the actual BOM detection.
This removes the JavaScriptObjectDeserializer.cs file
* JsonValue.cs: We need to use Convert.ToXXXX for numbers as we
always end up reporting the value JsonType.Number regardless of
the underlying storage (int, long or decimal). The parser
picks the best storage suitable for the data, and can end up using
"ints" for values that sometimes use longs.
This causes problems when derefercing the data for example, if you
have an int and try to get it out as a long you end up with an
invalid cast exception.
svn path=/trunk/mcs/; revision=154613
in System.ServiceModel.Web:
* JavaScriptReader.cs : moved from Sys.Json/JsonReader.cs.
* net_2_0_System.ServiceModel.Web.dll.sources,
net_2_1_raw_System.ServiceModel.Web.dll.sources :
move JsonReader.cs as Sys.R.S.Json/JavaScriptReader.cs
in System.Json:
* JsonReader.cs : moved to Sys.SM.Web/Sys.R.S.Json.
* System.Json.dll.sources : remove JsonReader.cs.
svn path=/trunk/mcs/; revision=153393
in System.ServiceModel.Web:
* JavaScriptObjectDeserializer.cs : new internal file, which is
used by System.Json (for moonlight compatibility).
* net_2_0_System.ServiceModel.Web.dll.sources,
net_2_1_raw_System.ServiceModel.Web.dll.sources :
add JavaScriptObjectDeserializer.cs and JsonReader in Sys.Json
(which is to be moved later).
* AssemblyInfo.cs: added InternalVisibleTo(System.Json). Also added
dummy 2.0 for easy testing.
in System.Json:
* JsonValue.cs : use Sys.SM.Web.dll's JavaScriptObjectDeserializer
for silverlight sdk / moonlight compatibility.
* JsonReader.cs : renamed to JavaScriptReader (for disambiguation in
Sys.SM.Web.dll). Now it is native-type based and used by the above
deserializer.
* Makefile : reference System.Xml and System.ServiceModel.Web (for
moonlight compatibility).
* AssemblyInfo.cs : use the same pub key in 2.0 (dummy), to ease
testing locally.
svn path=/trunk/mcs/; revision=153392
* JsonReader.cs : line endings after a value should not result in
a parse error.
* JsonObject.cs : duplicate object key "SHOULD" not be used, but
they are not rejected. So, make it a bit sloppy.
svn path=/trunk/mcs/; revision=151953
* JsonReader.cs : It seems it can either return int, long or decimal
depending on the value. Users cannot really predict what type of
the primitive value can be returned and casts to specific types
very likely fail. doh.
svn path=/trunk/mcs/; revision=150285
* JsonReader.cs : use decimal instead of int to parse decimal part
of numeric value. It can parse bigger value than int now (like
tweet id).
svn path=/trunk/mcs/; revision=150268