On 23 oct, 22:55, Brendan <bcke...@gmail.com> wrote: > I realize this post is coming at the end of the day on friday, but > hopefully it will get a look =) > > Going through the different JSON parsing implementations available for > GWT out there, almost all of them rely on a straight eval and note > that they should only be used for trusted code. The old JSONValue code > seems kind of quaint in light of JavaScriptObjects, and looking > through the trunk it looks like there's just a TODO in JsonUtils for > safe parsing.
Funny! I'm finishing a JsonUtils patch (was about to submit it this night but finally chose to review it one more time, ensuring tests pass, checkstyle, etc.) adding: - JsonUtils.safeParse - JsonUtils.stringify - JsonUtils.isArray (equivalent of ECMAScript 5's Array.isArray) - deferred binding implementations using either native support (user.agent=ie8) or emulation (eval() for the parsing; user.agent= {ie6,gecko,opera}), and a fallback to emulation when native support isn't available (e.g. recent versions of Firefox, Chrome and Safari have native support, but older versions do not, so we detect if native JSON is supported –recent versions– and fallback to emulation otherwise –older versions–; user.agent={gecko1_8,safari}) I'm using a similar code at work with no problem so far. I'll ping when my patch is sent for review. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---