On 30 juin, 21:16, "Jason.Sadler" <jason.sad...@gmail.com> wrote:
> I've been searching around to see if anyone's brought this up already
> - I haven't found anything (which surprises me) so my apologies if
> this is a repeat.
> Browsers are slowly starting to support native JSON - I know in
> particular Firefox 3.5 (released today) supports it and I'm under the
> impression (although I haven't really done my homework on this one)
> that some others already support it, or are working towards it.

IE8 does already support it. Next version of Safari will (4.1?), as
well as Chrome 3 (maybe some version of Chrome 2 already has it,
haven't checked). Don't know about the upcoming Opera 10.

> Are
> there any plans to change the GWT JSONParser to use native JSON
> parsing instead of the slower and less-safe "eval" function?

I think there are rather plans to replace the com.google.gwt.json.JSON
module with a better one (search the issue tracker and/or the group
archives). And when you're using JSO overlays, you already probably
have your own native method doing an eval(), that you can fix to use
native JSON parsing if supported.

> A very
> simple check along the lines of
>
> if (undefined != JSON)
> {
>     JSON.parse(myString);}
>
> else
> {
>     eval('(' + myString ' + ')');
>
> }
>
> ought to do it, right?

A better fix would be to store the function into a variable, so that
you only check for "JSON != undefined" once; but yes, it'd do it (and
for the user.agent=ie8 permutation, it could be set to using native
JSON, as it is know to be supported in this case)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to