On 19 août, 01:12, Jeff Chimene <[email protected]> wrote:
> On 08/18/2009 04:01 PM, Thomas Broyer wrote:
>
> > Well, JSONParser actually calls eval() *with* the wrapping
> > parentheses.
>
> Are they added in the parent?
>
> Checking the trunk source, I don't see that concatenation:
>
>   public static JSONValue parse(String jsonString) {
>     if (jsonString == null) {
>       throw new NullPointerException();
>     }
>     if (jsonString.length() == 0) {
>       throw new IllegalArgumentException("empty argument");
>     }
>     try {
>       return evaluate(jsonString);
>     } catch (JavaScriptException ex) {
>       throw new JSONException(ex);
>     }
>   }

>From the very same file:
  private static native JSONValue evaluate(String jsonString) /*-{
    var v = eval('(' + jsonString + ')');
    var func = @com.google.gwt.json.client.JSONParser::typeMap[typeof
v];
    return func ? func(v) :
@com.google.gwt.json.client.JSONParser::throwUnknownTypeException
(Ljava/lang/String;)(typeof v);
  }-*/;

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to