Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@ -66,11 +66,7 @@ namespace System.Web.Script.Serialization
ScriptingJsonSerializationSection section = (ScriptingJsonSerializationSection) ConfigurationManager.GetSection ("system.web.extensions/scripting/webServices/jsonSerialization");
if (section == null) {
#if NET_3_5
_maxJsonLength = 2097152;
#else
_maxJsonLength = 102400;
#endif
_recursionLimit = 100;
} else {
_maxJsonLength = section.MaxJsonLength;
@ -133,11 +129,7 @@ namespace System.Web.Script.Serialization
return (T) ConvertToType (obj, typeof (T));
}
#if NET_4_0
public
#else
internal
#endif
object ConvertToType (object obj, Type targetType)
{
if (obj == null)
@ -204,7 +196,11 @@ namespace System.Web.Script.Serialization
}
public object Deserialize (string input, Type targetType) {
return DeserializeObjectInternal (input);
object obj = DeserializeObjectInternal (input);
if (obj == null) return null;
return ConvertToType (obj, targetType);
}
static object Evaluate (object value) {