From bf35b32a208f0e2ca7e843b4ae89886e028e6fd5 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 31 Aug 2015 10:56:59 +0200 Subject: [PATCH 1/5] Suppress extraRequire compiler check in generated exports --- tasks/generate-exports.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/generate-exports.js b/tasks/generate-exports.js index 7651478473..3394e670f4 100644 --- a/tasks/generate-exports.js +++ b/tasks/generate-exports.js @@ -175,7 +175,7 @@ function generateExports(symbols, namespace) { blocks.unshift( '/**\n' + ' * @fileoverview Custom exports file.\n' + - ' * @suppress {checkVars}\n' + + ' * @suppress {checkVars,extraRequire}\n' + ' */\n'); return blocks.join('\n'); } From 07b1f5ea457beb4708b608c2e3b072996d181694 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 7 Sep 2015 09:47:32 +0200 Subject: [PATCH 2/5] Enable all the compiler checks --- config/example.json | 37 +++++-------------------------------- config/examples-all.json | 39 ++++++--------------------------------- config/ol.json | 39 ++++++--------------------------------- 3 files changed, 17 insertions(+), 98 deletions(-) diff --git a/config/example.json b/config/example.json index 248932c3ca..2ad9073a13 100644 --- a/config/example.json +++ b/config/example.json @@ -29,40 +29,13 @@ "goog.DEBUG=false" ], "jscomp_error": [ - "accessControls", - "ambiguousFunctionDecl", - "checkEventfulObjectDisposal", - "checkRegExp", - "checkTypes", - "checkVars", - "const", - "constantProperty", - "deprecated", - "duplicateMessage", - "es3", - "es5Strict", - "externsValidation", - "fileoverviewTags", - "globalThis", - "internetExplorerChecks", - "invalidCasts", - "misplacedTypeAnnotation", - "missingGetCssName", - "missingProperties", - "missingProvide", - "missingRequire", - "missingReturn", - "newCheckTypes", - "nonStandardJsDocs", - "suspiciousCode", - "strictModuleDepCheck", - "typeInvalidation", - "undefinedNames", - "undefinedVars", - "uselessCode", - "visibility" + "*" ], "jscomp_off": [ + "useOfGoogBase", + "unnecessaryCasts", + "lintChecks", + "missingProvide", "unknownDefines" ], "extra_annotation_name": [ diff --git a/config/examples-all.json b/config/examples-all.json index f29356b6a6..3994572934 100644 --- a/config/examples-all.json +++ b/config/examples-all.json @@ -30,39 +30,12 @@ "goog.DEBUG=false" ], "jscomp_error": [ - "accessControls", - "ambiguousFunctionDecl", - "checkEventfulObjectDisposal", - "checkRegExp", - "checkTypes", - "checkVars", - "const", - "constantProperty", - "deprecated", - "duplicateMessage", - "es3", - "es5Strict", - "externsValidation", - "fileoverviewTags", - "globalThis", - "internetExplorerChecks", - "invalidCasts", - "misplacedTypeAnnotation", - "missingGetCssName", - "missingProperties", - "missingProvide", - "missingRequire", - "missingReturn", - "newCheckTypes", - "nonStandardJsDocs", - "suspiciousCode", - "strictModuleDepCheck", - "typeInvalidation", - "undefinedNames", - "undefinedVars", - "unknownDefines", - "uselessCode", - "visibility" + "*" + ], + "jscomp_off": [ + "useOfGoogBase", + "unnecessaryCasts", + "lintChecks" ], "extra_annotation_name": [ "api", "observable" diff --git a/config/ol.json b/config/ol.json index e8db02a742..1720249833 100644 --- a/config/ol.json +++ b/config/ol.json @@ -20,39 +20,12 @@ "goog.DEBUG=false" ], "jscomp_error": [ - "accessControls", - "ambiguousFunctionDecl", - "checkEventfulObjectDisposal", - "checkRegExp", - "checkTypes", - "checkVars", - "const", - "constantProperty", - "deprecated", - "duplicateMessage", - "es3", - "es5Strict", - "externsValidation", - "fileoverviewTags", - "globalThis", - "internetExplorerChecks", - "invalidCasts", - "misplacedTypeAnnotation", - "missingGetCssName", - "missingProperties", - "missingProvide", - "missingRequire", - "missingReturn", - "newCheckTypes", - "nonStandardJsDocs", - "suspiciousCode", - "strictModuleDepCheck", - "typeInvalidation", - "undefinedNames", - "undefinedVars", - "unknownDefines", - "uselessCode", - "visibility" + "*" + ], + "jscomp_off": [ + "useOfGoogBase", + "unnecessaryCasts", + "lintChecks" ], "extra_annotation_name": [ "api", "observable" From d41bb2663b946bbfd37d45338eb4650125bad2db Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 7 Sep 2015 09:47:52 +0200 Subject: [PATCH 3/5] Add esrijson externs in config/example.json --- config/example.json | 1 + 1 file changed, 1 insertion(+) diff --git a/config/example.json b/config/example.json index 2ad9073a13..0489a00db9 100644 --- a/config/example.json +++ b/config/example.json @@ -14,6 +14,7 @@ "externs/bingmaps.js", "externs/bootstrap.js", "externs/closure-compiler.js", + "externs/esrijson.js", "externs/example.js", "externs/fastclick.js", "externs/geojson.js", From d702aad450cd891b0e413d99510494d4dc9ea3d3 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 7 Sep 2015 10:01:59 +0200 Subject: [PATCH 4/5] Fix return annotation in shaded-relief example --- examples/shaded-relief.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/shaded-relief.js b/examples/shaded-relief.js index b4e276741a..8cb308879a 100644 --- a/examples/shaded-relief.js +++ b/examples/shaded-relief.js @@ -13,7 +13,7 @@ goog.require('ol.source.XYZ'); * neighborhood for determining slope and aspect. * @param {Array.} inputs Array of input images. * @param {Object} data Data added in the "beforeoperations" event. - * @return {Array.} Output images (only the first is rendered). + * @return {ImageData} Output image. */ function shade(inputs, data) { var elevationImage = inputs[0]; From 4aa23692446d391d0d680bee6e473ee2ac4e134e Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Mon, 7 Sep 2015 10:05:12 +0200 Subject: [PATCH 5/5] Add missing type annotation in ol.format.WMSCapabilities The error reported by the compiler was: ``` ERR! compile src/ol/format/wmscapabilitiesformat.js:160: ERROR - inconsistent return type ERR! compile found : Array ERR! compile required: (null|ol.Extent|undefined) ERR! compile return [ ERR! compile ^ ERR! compile ``` --- src/ol/format/wmscapabilitiesformat.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/format/wmscapabilitiesformat.js b/src/ol/format/wmscapabilitiesformat.js index edc80ef30b..52108caa0d 100644 --- a/src/ol/format/wmscapabilitiesformat.js +++ b/src/ol/format/wmscapabilitiesformat.js @@ -157,10 +157,10 @@ ol.format.WMSCapabilities.readEXGeographicBoundingBox_ = !goog.isDef(eastBoundLongitude) || !goog.isDef(northBoundLatitude)) { return undefined; } - return [ + return /** @type {ol.Extent} */ ([ westBoundLongitude, southBoundLatitude, eastBoundLongitude, northBoundLatitude - ]; + ]); };