Always use goog.json.parse and set goog.json.USE_NATIVE_JSON=true

This commit is contained in:
Frederic Junod
2014-07-02 15:56:48 +02:00
parent cf85079d22
commit 190db934ee
5 changed files with 4 additions and 15 deletions

View File

@@ -2,7 +2,6 @@ goog.provide('ol.format.JSONFeature');
goog.require('goog.asserts');
goog.require('goog.json');
goog.require('ol.BrowserFeature');
goog.require('ol.format.Feature');
goog.require('ol.format.FormatType');
@@ -32,12 +31,7 @@ ol.format.JSONFeature.prototype.getObject_ = function(source) {
if (goog.isObject(source)) {
return source;
} else if (goog.isString(source)) {
var object;
if (ol.BrowserFeature.HAS_JSON_PARSE) {
object = /** @type {Object} */ (JSON.parse(source));
} else {
object = goog.json.parse(source);
}
var object = goog.json.parse(source);
return goog.isDef(object) ? object : null;
} else {
goog.asserts.fail();