Wednesday, March 30, 2011

seemingly misleading verbiage in the documentation...

There seems to be some  mis-leading verbiage at the link http://code.google.com/webtoolkit/doc/latest/tutorial/JSON.html   :


"Another technique for a converting a JSON string into something you can work with is to use the static JSONParser.parse(String) method. GWT contains a full set of JSON types for manipulating 

JSON data in the com.google.gwt.json.client package. If you prefer to parse the JSON data, see the Developer's Guide, Working with JSON. Ultimately both techniques rely on the JavaScript 

eval() function; so you are still responsible for ensuring that you are using a trusted source of JSON data."



The above quote from the documentation gives an impression that JSONParser.parse(String) always makes use of eval() function . My understanding has been that "JSONParser" uses the browser's 

native json parser( i.e., window.JSON.parse(....))  where available(IE 8+, FF 3.5 +, not sure about the exact version on Chrome after which the native parsing is supported), and resorts to 

eval() only in the remaining situations.

I hope my understanding is accurate; if not please feel free to correct me.

If, in fact my understanding is correct the aforementioned verbiage from the documentation is, I am afraid, misleading and might have to changed.

Feedback welcome. 

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment