Use JsonUtils.safeEval() instead of directly calling eval().
Review-Link: http://gwt-code-reviews.appspot.com/1883803
Review by: goktug@google.com
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@11477 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/i18n/client/TimeZoneInfo.java b/user/src/com/google/gwt/i18n/client/TimeZoneInfo.java
index a0ab0a3..60d85e3 100644
--- a/user/src/com/google/gwt/i18n/client/TimeZoneInfo.java
+++ b/user/src/com/google/gwt/i18n/client/TimeZoneInfo.java
@@ -19,6 +19,7 @@
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArrayInteger;
import com.google.gwt.core.client.JsArrayString;
+import com.google.gwt.core.client.JsonUtils;
/**
* A JavaScript Overlay type on top of the JSON data describing everything we
@@ -38,13 +39,9 @@
* @return a TimeZoneInfo object made from the supplied JSON.
*/
public static TimeZoneInfo buildTimeZoneData(String json) {
- return (TimeZoneInfo) eval(json);
+ return JsonUtils.safeEval(json);
}
- private static native JavaScriptObject eval(String json) /*-{
- return eval("(" + json + ")");
- }-*/;
-
protected TimeZoneInfo() { }
public final native String getID() /*-{ return this.id; }-*/;