Prevent null array to be passed to ol.Collection

This commit is contained in:
Frederic Junod
2015-06-24 17:27:10 +02:00
parent dd132c9fad
commit 8cf57941ac
+4 -4
View File
@@ -79,7 +79,7 @@ ol.CollectionProperty = {
* @constructor * @constructor
* @extends {ol.Object} * @extends {ol.Object}
* @fires ol.CollectionEvent * @fires ol.CollectionEvent
* @param {Array.<T>=} opt_array Array. * @param {!Array.<T>=} opt_array Array.
* @template T * @template T
* @api stable * @api stable
*/ */
@@ -89,7 +89,7 @@ ol.Collection = function(opt_array) {
/** /**
* @private * @private
* @type {Array.<T>} * @type {!Array.<T>}
*/ */
this.array_ = goog.isDef(opt_array) ? opt_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 * Add elements to the collection. This pushes each item in the provided array
* to the end of the collection. * to the end of the collection.
* @param {Array.<T>} arr Array. * @param {!Array.<T>} arr Array.
* @return {ol.Collection.<T>} This collection. * @return {ol.Collection.<T>} This collection.
* @api stable * @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 * 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 * collection's "length" property won't be in sync with the actual length
* of the array. * of the array.
* @return {Array.<T>} Array. * @return {!Array.<T>} Array.
* @api stable * @api stable
*/ */
ol.Collection.prototype.getArray = function() { ol.Collection.prototype.getArray = function() {