From 9f79d3348641001022fef6bd6c3982b26e0bd236 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Thu, 9 Jan 2014 09:53:18 +0100 Subject: [PATCH] Create 'type' annotation for 'const' variables From https://developers.google.com/closure/compiler/docs/js-for-compiler: "The type declaration and additional comment are optional. If you provide a type declaration, put the declaration on a separate line." --- src/ol/browserfeature.js | 21 ++++++++++++++------- src/ol/css.js | 6 ++++-- src/ol/interaction/dragzoominteraction.js | 3 ++- src/ol/proj/proj.js | 6 ++++-- src/ol/source/stamensource.js | 3 ++- src/ol/sphere/normal.js | 3 ++- src/ol/sphere/wgs84sphere.js | 3 ++- src/ol/structs/priorityqueue.js | 3 ++- 8 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/ol/browserfeature.js b/src/ol/browserfeature.js index ab229e2cfa..b8b9614ea8 100644 --- a/src/ol/browserfeature.js +++ b/src/ol/browserfeature.js @@ -32,7 +32,8 @@ ol.ENABLE_WEBGL = true; /** * The ratio between physical pixels and device-independent pixels * (dips) on the device (`window.devicePixelRatio`). - * @const {number} + * @const + * @type {number} * @todo stability experimental */ ol.BrowserFeature.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1; @@ -40,7 +41,8 @@ ol.BrowserFeature.DEVICE_PIXEL_RATIO = goog.global.devicePixelRatio || 1; /** * True if browser supports Canvas. - * @const {boolean} + * @const + * @type {boolean} * @todo stability experimental */ ol.BrowserFeature.HAS_CANVAS = ol.ENABLE_CANVAS && ( @@ -63,7 +65,8 @@ ol.BrowserFeature.HAS_CANVAS = ol.ENABLE_CANVAS && ( /** * Indicates if DeviceOrientation is supported in the user's browser. - * @const {boolean} + * @const + * @type {boolean} * @todo stability experimental */ ol.BrowserFeature.HAS_DEVICE_ORIENTATION = @@ -72,7 +75,8 @@ ol.BrowserFeature.HAS_DEVICE_ORIENTATION = /** * True if browser supports DOM. - * @const {boolean} + * @const + * @type {boolean} * @todo stability experimental */ ol.BrowserFeature.HAS_DOM = ol.ENABLE_DOM; @@ -80,7 +84,8 @@ ol.BrowserFeature.HAS_DOM = ol.ENABLE_DOM; /** * Is HTML5 geolocation supported in the current browser? - * @const {boolean} + * @const + * @type {boolean} * @todo stability experimental */ ol.BrowserFeature.HAS_GEOLOCATION = 'geolocation' in goog.global.navigator; @@ -88,7 +93,8 @@ ol.BrowserFeature.HAS_GEOLOCATION = 'geolocation' in goog.global.navigator; /** * True if browser supports touch events. - * @const {boolean} + * @const + * @type {boolean} * @todo stability experimental */ ol.BrowserFeature.HAS_TOUCH = ol.ASSUME_TOUCH || @@ -99,7 +105,8 @@ ol.BrowserFeature.HAS_TOUCH = ol.ASSUME_TOUCH || /** * True if browser supports WebGL. - * @const {boolean} + * @const + * @type {boolean} * @todo stability experimental */ ol.BrowserFeature.HAS_WEBGL = ol.ENABLE_WEBGL && ( diff --git a/src/ol/css.js b/src/ol/css.js index 5dbbddd11d..80eb7b523d 100644 --- a/src/ol/css.js +++ b/src/ol/css.js @@ -4,7 +4,8 @@ goog.provide('ol.css'); /** * The CSS class that we'll give the DOM elements to have them unselectable. * - * @const {string} + * @const + * @type {string} */ ol.css.CLASS_UNSELECTABLE = 'ol-unselectable'; @@ -12,6 +13,7 @@ ol.css.CLASS_UNSELECTABLE = 'ol-unselectable'; /** * The CSS class for unsupported feature. * - * @const {string} + * @const + * @type {string} */ ol.css.CLASS_UNSUPPORTED = 'ol-unsupported'; diff --git a/src/ol/interaction/dragzoominteraction.js b/src/ol/interaction/dragzoominteraction.js index 2cc9ed0e99..62c0727c63 100644 --- a/src/ol/interaction/dragzoominteraction.js +++ b/src/ol/interaction/dragzoominteraction.js @@ -20,7 +20,8 @@ ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS = 8; /** - * @const {number} + * @const + * @type {number} */ ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS_SQUARED = ol.SHIFT_DRAG_ZOOM_HYSTERESIS_PIXELS * diff --git a/src/ol/proj/proj.js b/src/ol/proj/proj.js index c0c750a88f..c1ca1b1a68 100644 --- a/src/ol/proj/proj.js +++ b/src/ol/proj/proj.js @@ -19,7 +19,8 @@ ol.ENABLE_PROJ4JS = true; /** * Have Proj4js. - * @const {boolean} + * @const + * @type {boolean} */ ol.HAVE_PROJ4JS = ol.ENABLE_PROJ4JS && typeof Proj4js == 'object'; @@ -47,7 +48,8 @@ ol.proj.Units = { /** * Meters per unit lookup table. - * @const {Object.} + * @const + * @type {Object.} */ ol.METERS_PER_UNIT = {}; ol.METERS_PER_UNIT[ol.proj.Units.DEGREES] = diff --git a/src/ol/source/stamensource.js b/src/ol/source/stamensource.js index 6a269206f7..296bb58347 100644 --- a/src/ol/source/stamensource.js +++ b/src/ol/source/stamensource.js @@ -113,7 +113,8 @@ goog.inherits(ol.source.Stamen, ol.source.XYZ); /** - * @const {Array.} + * @const + * @type {Array.} */ ol.source.Stamen.ATTRIBUTIONS = [ new ol.Attribution({ diff --git a/src/ol/sphere/normal.js b/src/ol/sphere/normal.js index e07bf000b4..70e6f8e165 100644 --- a/src/ol/sphere/normal.js +++ b/src/ol/sphere/normal.js @@ -5,6 +5,7 @@ goog.require('ol.Sphere'); /** * The normal sphere. - * @const {ol.Sphere} + * @const + * @type {ol.Sphere} */ ol.sphere.NORMAL = new ol.Sphere(6370997); diff --git a/src/ol/sphere/wgs84sphere.js b/src/ol/sphere/wgs84sphere.js index e30aafeb4b..19624fd6b2 100644 --- a/src/ol/sphere/wgs84sphere.js +++ b/src/ol/sphere/wgs84sphere.js @@ -5,6 +5,7 @@ goog.require('ol.Sphere'); /** * A sphere with radius equal to the semi-major axis of the WGS84 ellipsoid. - * @const {ol.Sphere} + * @const + * @type {ol.Sphere} */ ol.sphere.WGS84 = new ol.Sphere(6378137); diff --git a/src/ol/structs/priorityqueue.js b/src/ol/structs/priorityqueue.js index 72b4019475..714c59dd64 100644 --- a/src/ol/structs/priorityqueue.js +++ b/src/ol/structs/priorityqueue.js @@ -56,7 +56,8 @@ ol.structs.PriorityQueue = function(priorityFunction, keyFunction) { /** - * @const {number} + * @const + * @type {number} */ ol.structs.PriorityQueue.DROP = Infinity;