From dd132c9fad41230b6106884cde8ad90f5f130505 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 24 Jun 2015 17:26:56 +0200 Subject: [PATCH 1/2] Add non-nullable notation to features array --- src/ol/interaction/selectinteraction.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/interaction/selectinteraction.js b/src/ol/interaction/selectinteraction.js index 6c4b73d8e4..12db606644 100644 --- a/src/ol/interaction/selectinteraction.js +++ b/src/ol/interaction/selectinteraction.js @@ -221,8 +221,8 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) { var set = !add && !remove && !toggle; var map = mapBrowserEvent.map; var features = this.featureOverlay_.getSource().getFeaturesCollection(); - var /** @type {Array.} */ deselected = []; - var /** @type {Array.} */ selected = []; + var /** @type {!Array.} */ deselected = []; + var /** @type {!Array.} */ selected = []; var change = false; if (set) { // Replace the currently selected feature(s) with the feature(s) at the From 8cf57941ac3c0c6d02f8b8344b2675c49f71bf80 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 24 Jun 2015 17:27:10 +0200 Subject: [PATCH 2/2] Prevent null array to be passed to ol.Collection --- src/ol/collection.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/collection.js b/src/ol/collection.js index 81ead47d4f..a679dca011 100644 --- a/src/ol/collection.js +++ b/src/ol/collection.js @@ -79,7 +79,7 @@ ol.CollectionProperty = { * @constructor * @extends {ol.Object} * @fires ol.CollectionEvent - * @param {Array.=} opt_array Array. + * @param {!Array.=} opt_array Array. * @template T * @api stable */ @@ -89,7 +89,7 @@ ol.Collection = function(opt_array) { /** * @private - * @type {Array.} + * @type {!Array.} */ this.array_ = goog.isDef(opt_array) ? opt_array : []; @@ -113,7 +113,7 @@ ol.Collection.prototype.clear = function() { /** * Add elements to the collection. This pushes each item in the provided array * to the end of the collection. - * @param {Array.} arr Array. + * @param {!Array.} arr Array. * @return {ol.Collection.} This collection. * @api stable */ @@ -145,7 +145,7 @@ ol.Collection.prototype.forEach = function(f, opt_this) { * is mutated, no events will be dispatched by the collection, and the * collection's "length" property won't be in sync with the actual length * of the array. - * @return {Array.} Array. + * @return {!Array.} Array. * @api stable */ ol.Collection.prototype.getArray = function() {