From 0707deb465a4494e40c89ee783d0ca5c20fd88e5 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 19 Feb 2013 14:28:59 -0700 Subject: [PATCH] Properties set with set should not be accessed with bracket --- src/ol/collection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ol/collection.js b/src/ol/collection.js index f1de3a535e..86c331302f 100644 --- a/src/ol/collection.js +++ b/src/ol/collection.js @@ -93,7 +93,7 @@ goog.inherits(ol.Collection, ol.Object); * Remove all elements from the collection. */ ol.Collection.prototype.clear = function() { - while (this[ol.CollectionProperty.LENGTH]) { + while (this.getLength() > 0) { this.pop(); } }; @@ -187,7 +187,7 @@ ol.Collection.prototype.removeAt = function(index) { * @param {*} elem Element. */ ol.Collection.prototype.setAt = function(index, elem) { - var n = this[ol.CollectionProperty.LENGTH]; + var n = this.getLength(); if (index < n) { var prev = this.array_[index]; this.array_[index] = elem;