From 66da8fc393fd0034dedc4fbe0ce1df9151d27ad1 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 21 Jul 2014 10:08:30 +0200 Subject: [PATCH 1/3] Upgrade closure-library version --- closure-util.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" } From cf85079d2210fee3127e0900a43a8ad702f2ad86 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 21 Jul 2014 09:59:13 +0200 Subject: [PATCH 2/3] Mark 'es5Strict' checks as errors --- build.py | 4 +--- buildcfg/examples-all.json | 4 +--- buildcfg/ol.json | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/build.py b/build.py index b8eb25358c..2c394c5c76 100755 --- a/build.py +++ b/build.py @@ -254,6 +254,7 @@ def examples_star_json(name, match): "duplicate", "duplicateMessage", "es3", + "es5Strict", "externsValidation", "fileoverviewTags", "globalThis", @@ -276,9 +277,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..55deb4037f 100644 --- a/buildcfg/examples-all.json +++ b/buildcfg/examples-all.json @@ -33,6 +33,7 @@ "deprecated", "duplicateMessage", "es3", + "es5Strict", "externsValidation", "fileoverviewTags", "globalThis", @@ -58,9 +59,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..cb5cb4d117 100644 --- a/buildcfg/ol.json +++ b/buildcfg/ol.json @@ -29,6 +29,7 @@ "deprecated", "duplicateMessage", "es3", + "es5Strict", "externsValidation", "fileoverviewTags", "globalThis", @@ -54,9 +55,6 @@ "extra_annotation_name": [ "api", "observable" ], - "jscomp_off": [ - "es5Strict" - ], "compilation_level": "ADVANCED", "output_wrapper": "(function(){%output%})();", "use_types_for_optimization": true, From 190db934eefe62ed5cf4814a24e81382fe89e7d4 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 2 Jul 2014 15:56:48 +0200 Subject: [PATCH 3/3] Always use goog.json.parse and set goog.json.USE_NATIVE_JSON=true --- build.py | 1 + buildcfg/examples-all.json | 1 + buildcfg/ol.json | 1 + src/ol/browserfeature.js | 8 -------- src/ol/format/jsonfeatureformat.js | 8 +------- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/build.py b/build.py index 2c394c5c76..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": [ diff --git a/buildcfg/examples-all.json b/buildcfg/examples-all.json index 55deb4037f..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": [ diff --git a/buildcfg/ol.json b/buildcfg/ol.json index cb5cb4d117..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": [ 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();