diff --git a/build.py b/build.py index b8eb25358c..4b30d64173 100755 --- a/build.py +++ b/build.py @@ -236,6 +236,7 @@ def examples_star_json(name, match): ], "define": [ "goog.dom.ASSUME_STANDARDS_MODE=true", + "goog.json.USE_NATIVE_JSON=true", "goog.DEBUG=false" ], "jscomp_error": [ @@ -254,6 +255,7 @@ def examples_star_json(name, match): "duplicate", "duplicateMessage", "es3", + "es5Strict", "externsValidation", "fileoverviewTags", "globalThis", @@ -276,9 +278,6 @@ def examples_star_json(name, match): "extra_annotation_name": [ "api", "observable" ], - "jscomp_off": [ - "es5Strict" - ], "compilation_level": "ADVANCED", "output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();", "use_types_for_optimization": True, diff --git a/buildcfg/examples-all.json b/buildcfg/examples-all.json index 5e2b2f5b5a..599762fffd 100644 --- a/buildcfg/examples-all.json +++ b/buildcfg/examples-all.json @@ -18,6 +18,7 @@ ], "define": [ "goog.dom.ASSUME_STANDARDS_MODE=true", + "goog.json.USE_NATIVE_JSON=true", "goog.DEBUG=false" ], "jscomp_error": [ @@ -33,6 +34,7 @@ "deprecated", "duplicateMessage", "es3", + "es5Strict", "externsValidation", "fileoverviewTags", "globalThis", @@ -58,9 +60,6 @@ "extra_annotation_name": [ "api", "observable" ], - "jscomp_off": [ - "es5Strict" - ], "compilation_level": "ADVANCED", "output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();", "use_types_for_optimization": true, diff --git a/buildcfg/ol.json b/buildcfg/ol.json index 10a459b8c2..bd721f5b31 100644 --- a/buildcfg/ol.json +++ b/buildcfg/ol.json @@ -14,6 +14,7 @@ ], "define": [ "goog.dom.ASSUME_STANDARDS_MODE=true", + "goog.json.USE_NATIVE_JSON=true", "goog.DEBUG=false" ], "jscomp_error": [ @@ -29,6 +30,7 @@ "deprecated", "duplicateMessage", "es3", + "es5Strict", "externsValidation", "fileoverviewTags", "globalThis", @@ -54,9 +56,6 @@ "extra_annotation_name": [ "api", "observable" ], - "jscomp_off": [ - "es5Strict" - ], "compilation_level": "ADVANCED", "output_wrapper": "(function(){%output%})();", "use_types_for_optimization": true, diff --git a/closure-util.json b/closure-util.json index 8a8a5f56bb..572ab67504 100644 --- a/closure-util.json +++ b/closure-util.json @@ -1,3 +1,3 @@ { - "library_url": "https://github.com/google/closure-library/archive/ab89cf45c216615d73a2f5dea720afb9d3415d1f.zip" + "library_url": "https://github.com/google/closure-library/archive/946a7d39d4ffe08676c755b21d901e71d9904a3b.zip" } diff --git a/src/ol/browserfeature.js b/src/ol/browserfeature.js index 74baa0f400..078e14a269 100644 --- a/src/ol/browserfeature.js +++ b/src/ol/browserfeature.js @@ -89,14 +89,6 @@ ol.BrowserFeature.HAS_DOM = ol.ENABLE_DOM; ol.BrowserFeature.HAS_GEOLOCATION = 'geolocation' in goog.global.navigator; -/** - * @const - * @type {boolean} - */ -ol.BrowserFeature.HAS_JSON_PARSE = - 'JSON' in goog.global && 'parse' in goog.global.JSON; - - /** * True if browser supports touch events. * @const diff --git a/src/ol/format/jsonfeatureformat.js b/src/ol/format/jsonfeatureformat.js index 912c6f01c5..8997b4f9ff 100644 --- a/src/ol/format/jsonfeatureformat.js +++ b/src/ol/format/jsonfeatureformat.js @@ -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();