Properties set with set should not be accessed with bracket

This commit is contained in:
Tim Schaub
2013-02-19 14:28:59 -07:00
parent 052e995f2e
commit 0707deb465

View File

@@ -93,7 +93,7 @@ goog.inherits(ol.Collection, ol.Object);
* Remove all elements from the collection. * Remove all elements from the collection.
*/ */
ol.Collection.prototype.clear = function() { ol.Collection.prototype.clear = function() {
while (this[ol.CollectionProperty.LENGTH]) { while (this.getLength() > 0) {
this.pop(); this.pop();
} }
}; };
@@ -187,7 +187,7 @@ ol.Collection.prototype.removeAt = function(index) {
* @param {*} elem Element. * @param {*} elem Element.
*/ */
ol.Collection.prototype.setAt = function(index, elem) { ol.Collection.prototype.setAt = function(index, elem) {
var n = this[ol.CollectionProperty.LENGTH]; var n = this.getLength();
if (index < n) { if (index < n) {
var prev = this.array_[index]; var prev = this.array_[index];
this.array_[index] = elem; this.array_[index] = elem;