How to test JSON.parse method in through GWTTestCase?

63 views Asked by At

I have written a simple native method in GWT code as below:

public static native JavaScriptObject parseString(String jsonString) /*-{
        return JSON.parse(jsonString);

    }-*/;

Now I have GWTTestCase to validate this code but the test case is failing due to com.google.gwt.core.client.JavaScriptException.

When I pass same string to another method which is using java script eval() method internally, it is able to parse string appropriately.

So, does anyone have clue what could be the issue with JSON.parse(string) ?

0

There are 0 answers