[Mono-dev] Replicating System.Web.Script.Serialization bugs

Konstantin Triger kostat at mainsoft.com
Tue Sep 25 09:58:30 EDT 2007


> One workaround would be to slightly massage the script prior to
> deserialization. A regexp should remedy things, maybe?
This will kill performance, so can be a workaround implemented in app code only...

Regards,
Konstantin Triger

> -----Original Message-----
> From: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-
> bounces at lists.ximian.com] On Behalf Of Andreia Gaita
> Sent: Tuesday, September 25, 2007 12:23 PM
> To: Konstantin Triger
> Cc: mono-devel-list at lists.ximian.com
> Subject: Re: [Mono-dev] Replicating System.Web.Script.Serialization bugs
> 
> On 9/25/07, Konstantin Triger <kostat at mainsoft.com> wrote:
> > 1. For value types: since there is no notion of 'null' value (unlike
> many dymanic languages) it would be very hard to differentiate between the
> 'default' and deserialized values if they are equal. (If you have a field
> of type 'Int32' and its value after deserialization is 0, where is it
> from?!)
> 
> Actually, that problem was solved in the xml deserializer by having it
> set a helper property marking whether the value had originated from
> the xml or was merely a default one. Also, if javascript is weakly
> typed, it doesn't make sense to force initialization of variables if
> they are of a certain type, as that concept doesn't apply to it. So,
> in theory, this value pair should deserialize correctly.
> 
> Of course, all that is moot, since the ms.net deserializer blows up on
> it. 99% bug compatibility and all that...
> One workaround would be to slightly massage the script prior to
> deserialization. A regexp should remedy things, maybe?
> 
> > 2. For String type: should {"some_key" : ""} be deserialized to null or
> empty string?
> 
> Same thing as above - the value should not determine whether something
> was deliberately filled in or if it is just at the default value.
> 
> andreia gaita
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list