Commit Graph
27 Commits
Author SHA1 Message Date
Miguel de Icaza c236ec5ebc Ship System.Json for 2.0 and 4.0 as well.
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/
2011-08-12 18:34:53 -04:00
Miguel de Icaza 4a7c594eb1 [System.Json] Fix loader.
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
2011-03-08 17:54:28 -05:00
Jb Evain 444243c522 Add pretty print support for null values in JsonObjects 2010-10-14 14:00:41 +02:00
Jb Evain 9112013354 Allow null values in JsonObjects 2010-10-14 13:58:03 +02:00
Jb Evain 23b15a3d27 Fix the NET_2_1 build of System.Json 2010-09-01 15:58:39 +02:00
Jb Evain 040f24a7df [hygiene] simplify the code dealing with internal collections
Initialize the objets with the provided source at construction time
like SL does, and thus avoid dealing with two different sources.
2010-08-11 11:23:35 +02:00
Jb Evain fbe3813fb2 fix the System.Json build 2010-08-11 10:43:49 +02:00
Miguel de Icaza 9a1847e7e6 2010-04-01 Miguel de Icaza <[email protected]>
* 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
2010-04-01 06:39:52 +00:00
Atsushi Eno 6f0cd4a650 2010-03-10 Atsushi Enomoto <[email protected]>
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
2010-03-10 10:22:36 +00:00
Atsushi Eno 286c255027 2010-03-10 Atsushi Enomoto <[email protected]>
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
2010-03-10 10:17:24 +00:00
Atsushi Eno c2d585a1ea 2010-02-18 Atsushi Enomoto <[email protected]>
* JsonValue.cs : fix string escaping, it was giving wrong output
	  after \" and \\.


svn path=/trunk/mcs/; revision=151954
2010-02-18 07:07:16 +00:00
Atsushi Eno 20ede70ef0 2010-02-18 Atsushi Enomoto <[email protected]>
* 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
2010-02-18 04:43:03 +00:00
Atsushi Eno ae319ebc63 2010-01-27 Atsushi Enomoto <[email protected]>
* JsonReader.cs : oops, added previous change to wrong position.


svn path=/trunk/mcs/; revision=150287
2010-01-27 10:39:14 +00:00
Atsushi Eno 1bacfd9f5e 2010-01-27 Atsushi Enomoto <[email protected]>
* 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
2010-01-27 10:28:56 +00:00
Atsushi Eno a49c5de1bf 2010-01-27 Atsushi Enomoto <[email protected]>
* 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
2010-01-27 01:37:27 +00:00
Miguel de Icaza f2f69279bb Fix crash when the quote starts the string to escape
svn path=/trunk/mcs/; revision=149703
2010-01-17 05:50:35 +00:00
Miguel de Icaza 0ab8e519e5 This method needs to be overwritten from the JsonValue class
svn path=/trunk/mcs/; revision=149702
2010-01-17 05:43:27 +00:00
Geoff Norton f5938b9d55 ensure we add punctuation as characters, patch from john moshakis
svn path=/trunk/mcs/; revision=145361
2009-11-04 01:39:41 +00:00
Jb Evain 90674f8f18 revert 144379
svn path=/trunk/mcs/; revision=144380
2009-10-19 14:32:45 +00:00
Jb Evain ee77ea9870 2009-10-19 Jb Evain <[email protected]>
* JsonObject.cs, JsonArray.cs: backport r142424 and r143432.


svn path=/trunk/mcs/; revision=144379
2009-10-19 14:26:55 +00:00
Atsushi Eno 0c76f399c9 2009-10-05 Atsushi Enomoto <[email protected]>
* JsonReader.cs : \uXXXX parser was totally wrong, giving wrong #.


svn path=/trunk/mcs/; revision=143432
2009-10-05 18:46:36 +00:00
Atsushi Eno 2c83ff30ac 2009-09-22 Atsushi Enomoto <[email protected]>
* JsonValue.cs, JsonReader.cs, JsonPrimitive.cs :
	  Handle "null" values, as string, so far (haven't tried what .NET
	  actually does).
	  Fix array ToString() that missed commas (while Save() worked fine -
	  it has different serialization logic).


svn path=/trunk/mcs/; revision=142424
2009-09-22 17:35:35 +00:00
Atsushi Eno 5b2374b248 2009-08-13 Atsushi Enomoto <[email protected]>
* class/System.Json/Makefile: add System.Json to net_4_0 profile.

	* class/Makefile : update profile check.


svn path=/trunk/mcs/; revision=139835
2009-08-13 10:26:45 +00:00
Atsushi Eno f3f961589b 2009-01-15 Atsushi Enomoto <[email protected]>
* JsonReader.cs : consume ',' between items in an array.


svn path=/trunk/mcs/; revision=123446
2009-01-15 02:59:13 +00:00
Atsushi Eno 16a79839e2 2008-09-15 Atsushi Enomoto <[email protected]>
* JsonObject.cs, JsonValue.cs : SL2b2 updates.


svn path=/trunk/mcs/; revision=112982
2008-09-15 03:51:41 +00:00
Atsushi Eno 631055245f 2008-08-28 Atsushi Enomoto <[email protected]>
* JsonReader.cs : a ReadChar() is missing in number parsing.


svn path=/trunk/mcs/; revision=111791
2008-08-28 09:24:52 +00:00
Atsushi Eno 66ecab0058 initial checkin. New assembly in Silverlight 2.0 beta 2.
svn path=/trunk/mcs/; revision=105468
2008-06-10 16:49:49 +00:00