Abstract classes can still have subclasses with KnownType attributes, which are allowed in deserialization.
This used to work as the '__type' hint was always honored no matter the type, and broke with https://github.com/mono/mono/commit/71e152accc727089faffa6b4fd6bf58cb62636cf which removed that behavior.
- 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
Issue: The previous code, with new tests [1], failed when the linker was
enabled.
That was caused because the code looks for the Keys and Item properties
getter using reflection. The linker handled that imperfectly (it left
some holes), in part because:
* System.Collections.Generic.IDictionary`2 does not implement
System.Collections.IDictionary; and
* It preserved the explicit methods - not the implicit one that were
used the the reflection-based code;
That later fact is also a bug (without the linker involvment) and solved
by this commit. A unit test was added to show the issue (NRE).
The patch also avoid the use of reflection for IDictionary since we can
simply typecast to get the same result (without the additional cost).
This reverts commit 87e95b46ed.
This puts DataContractJsonSerializerSettings.cs back into
mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json.
Let's please not have a single file from this namespace in another
directory, either move the entire System.Runtime.Serialization.Json
stuff into System.Runtime.Serialization or leave it here.
* Move System.Runtime.Serialization.Json from System.ServiceModel.Web.dll
into System.Runtime.Serialization.dll on the mobile profile.
* Add DataContractJsonSerializerSettings and DataContractSerializerSettings..
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
On Moonlight, ScriptObject types have custom (de)serialization methods that
need to be called whenever a user object includes properties of that type.
This patch creates a TypeMap subclass (ExternalTypeMap) and exposes a method
that can be called from moon's System.Windows.Browser to register custom
serialization and deserialization methods, keyed by type. These are called
whenever a property is found with a type (or base type) that has custom
methods registered.