}
public static <T> T decode(Context context, Scriptable scope, Object value, Class<T> type) {
Object json = NativeJSON.stringify(context, scope, value, null, null);
Gson gson = new Gson();
return gson.fromJson((String) json, type);
}
public static <T> T decode(Context context, Scriptable scope, Object value, TypeToken<T> type) {
Object json = NativeJSON.stringify(context, scope, value, null, null);
Gson gson = new Gson();