JamesNK/Newtonsoft.Json — pull request #146 by Athari (2013-10-23 13:38:21+00:00)
Title: Fixed #143 (JObject's implementation of ICustomTypeDescriptor.GetProperties returns incorrect property types)

`PropertyDescriptor.PropertyType` must return the type of the *property*, not the type of the *current value* (and neither the type of the *unwrapped current value*). Considering properties in `JObject` can be assigned a value of any type, the correct property type is `object`. Returning `JToken` should probably be avoided, because, in case the code checks types of values assigned to dynamic properties (these checks are present in the framework, for example in WPF bindings), this will limit already provided functionality (wrapping in `JValue`).

**Implementation details:** removed `_propertyType` field from `JPropertyDescriptor`, removed all code which became redundant as a result. Argument check removed from the constructor, because it is already present in the base type.

**Possible backwards compatibility issues:** if someone manually calls methods of `ICustomTypeDescriptor` interface on `JObject` values and expects properties to return types of the current values, this code may be broken. However, this behavior is incorrect and must not be expected from any dynamic type descriptors. Workaround: get values after getting properties, check their types.