Skip to content

Commit

Permalink
Backport of r111956
Browse files Browse the repository at this point in the history
svn path=/branches/mono-2-0/mcs/; revision=111957
  • Loading branch information
grendello committed Aug 29, 2008
1 parent 5a6bb10 commit a0cd75d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions mcs/class/System.Web.Extensions/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2008-08-30 Marek Habersack <mhabersack@novell.com>

* System.Web.Script.Serialization/JavaScriptSerializer.cs: if the
target type is an IDictionary with value type of System.Object,
make sure to NOT convert any values.
Any values descendant from JavaScriptSerializer.LazyDictionary are
converted to Dictionary <string, object>

2008-08-28 Marek Habersack <mhabersack@novell.com>

* System.Web.Script.Services/LogicalTypeInfo.cs: Invoke does not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,14 @@ object ConvertToObject (IDictionary<string, object> dict, Type type)
foreach (KeyValuePair<string, object> entry in dict) {
object value = entry.Value;
if (target is IDictionary) {
((IDictionary) target).Add (entry.Key, ConvertToType (ReflectionUtils.GetTypedDictionaryValueType (type), value));
Type valueType = ReflectionUtils.GetTypedDictionaryValueType (type);
if (value != null && valueType == typeof (System.Object))
valueType = value.GetType ();

if (typeof (LazyDictionary).IsAssignableFrom (valueType))
valueType = typeof (Dictionary <string, object>);

((IDictionary) target).Add (entry.Key, ConvertToType (valueType, value));
continue;
}
MemberInfo [] memberCollection = type.GetMember (entry.Key);
Expand Down

0 comments on commit a0cd75d

Please sign in to comment.