Use goog.DEBUG instead of ol.DEBUG for now
This commit is contained in:
@@ -40,7 +40,7 @@ ol.structs.LRUCache = function() {
|
||||
};
|
||||
|
||||
|
||||
if (ol.DEBUG) {
|
||||
if (goog.DEBUG) {
|
||||
/**
|
||||
* FIXME empty description for jsdoc
|
||||
*/
|
||||
@@ -167,7 +167,7 @@ ol.structs.LRUCache.prototype.getKeys = function() {
|
||||
for (entry = this.newest_; entry; entry = entry.older) {
|
||||
keys[i++] = entry.key_;
|
||||
}
|
||||
ol.DEBUG && console.assert(i == this.count_, 'iterated correct number of times');
|
||||
goog.DEBUG && console.assert(i == this.count_, 'iterated correct number of times');
|
||||
return keys;
|
||||
};
|
||||
|
||||
@@ -182,7 +182,7 @@ ol.structs.LRUCache.prototype.getValues = function() {
|
||||
for (entry = this.newest_; entry; entry = entry.older) {
|
||||
values[i++] = entry.value_;
|
||||
}
|
||||
ol.DEBUG && console.assert(i == this.count_, 'iterated correct number of times');
|
||||
goog.DEBUG && console.assert(i == this.count_, 'iterated correct number of times');
|
||||
return values;
|
||||
};
|
||||
|
||||
@@ -191,7 +191,7 @@ ol.structs.LRUCache.prototype.getValues = function() {
|
||||
* @return {T} Last value.
|
||||
*/
|
||||
ol.structs.LRUCache.prototype.peekLast = function() {
|
||||
ol.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
goog.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
return this.oldest_.value_;
|
||||
};
|
||||
|
||||
@@ -200,7 +200,7 @@ ol.structs.LRUCache.prototype.peekLast = function() {
|
||||
* @return {string} Last key.
|
||||
*/
|
||||
ol.structs.LRUCache.prototype.peekLastKey = function() {
|
||||
ol.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
goog.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
return this.oldest_.key_;
|
||||
};
|
||||
|
||||
@@ -209,10 +209,10 @@ ol.structs.LRUCache.prototype.peekLastKey = function() {
|
||||
* @return {T} value Value.
|
||||
*/
|
||||
ol.structs.LRUCache.prototype.pop = function() {
|
||||
ol.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
ol.DEBUG && console.assert(this.newest_, 'newest must not be null');
|
||||
goog.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
goog.DEBUG && console.assert(this.newest_, 'newest must not be null');
|
||||
var entry = this.oldest_;
|
||||
ol.DEBUG && console.assert(entry.key_ in this.entries_,
|
||||
goog.DEBUG && console.assert(entry.key_ in this.entries_,
|
||||
'oldest is indexed in entries');
|
||||
delete this.entries_[entry.key_];
|
||||
if (entry.newer) {
|
||||
@@ -242,7 +242,7 @@ ol.structs.LRUCache.prototype.replace = function(key, value) {
|
||||
* @param {T} value Value.
|
||||
*/
|
||||
ol.structs.LRUCache.prototype.set = function(key, value) {
|
||||
ol.DEBUG && console.assert(!(key in {}),
|
||||
goog.DEBUG && console.assert(!(key in {}),
|
||||
'key is not a standard property of objects (e.g. "__proto__")');
|
||||
ol.assert(!(key in this.entries_),
|
||||
16); // Tried to set a value for a key that is used already
|
||||
|
||||
@@ -60,7 +60,7 @@ ol.structs.PriorityQueue = function(priorityFunction, keyFunction) {
|
||||
ol.structs.PriorityQueue.DROP = Infinity;
|
||||
|
||||
|
||||
if (ol.DEBUG) {
|
||||
if (goog.DEBUG) {
|
||||
/**
|
||||
* FIXME empty description for jsdoc
|
||||
*/
|
||||
@@ -99,7 +99,7 @@ ol.structs.PriorityQueue.prototype.clear = function() {
|
||||
*/
|
||||
ol.structs.PriorityQueue.prototype.dequeue = function() {
|
||||
var elements = this.elements_;
|
||||
ol.DEBUG && console.assert(elements.length > 0,
|
||||
goog.DEBUG && console.assert(elements.length > 0,
|
||||
'must have elements in order to be able to dequeue');
|
||||
var priorities = this.priorities_;
|
||||
var element = elements[0];
|
||||
@@ -112,7 +112,7 @@ ol.structs.PriorityQueue.prototype.dequeue = function() {
|
||||
this.siftUp_(0);
|
||||
}
|
||||
var elementKey = this.keyFunction_(element);
|
||||
ol.DEBUG && console.assert(elementKey in this.queuedElements_,
|
||||
goog.DEBUG && console.assert(elementKey in this.queuedElements_,
|
||||
'key %s is not listed as queued', elementKey);
|
||||
delete this.queuedElements_[elementKey];
|
||||
return element;
|
||||
|
||||
@@ -59,7 +59,7 @@ ol.structs.RBush.prototype.insert = function(extent, value) {
|
||||
|
||||
this.rbush_.insert(item);
|
||||
// remember the object that was added to the internal rbush
|
||||
ol.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
|
||||
goog.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
|
||||
'uid (%s) of value (%s) already exists', ol.getUid(value), value);
|
||||
this.items_[ol.getUid(value)] = item;
|
||||
};
|
||||
@@ -74,7 +74,7 @@ ol.structs.RBush.prototype.load = function(extents, values) {
|
||||
if (goog.DEBUG && this.readers_) {
|
||||
throw new Error('Can not insert values while reading');
|
||||
}
|
||||
ol.DEBUG && console.assert(extents.length === values.length,
|
||||
goog.DEBUG && console.assert(extents.length === values.length,
|
||||
'extens and values must have same length (%s === %s)',
|
||||
extents.length, values.length);
|
||||
|
||||
@@ -92,7 +92,7 @@ ol.structs.RBush.prototype.load = function(extents, values) {
|
||||
value: value
|
||||
};
|
||||
items[i] = item;
|
||||
ol.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
|
||||
goog.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
|
||||
'uid (%s) of value (%s) already exists', ol.getUid(value), value);
|
||||
this.items_[ol.getUid(value)] = item;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ ol.structs.RBush.prototype.remove = function(value) {
|
||||
throw new Error('Can not remove value while reading');
|
||||
}
|
||||
var uid = ol.getUid(value);
|
||||
ol.DEBUG && console.assert(uid in this.items_,
|
||||
goog.DEBUG && console.assert(uid in this.items_,
|
||||
'uid (%s) of value (%s) does not exist', uid, value);
|
||||
|
||||
// get the object in which the value was wrapped when adding to the
|
||||
@@ -127,7 +127,7 @@ ol.structs.RBush.prototype.remove = function(value) {
|
||||
* @param {T} value Value.
|
||||
*/
|
||||
ol.structs.RBush.prototype.update = function(extent, value) {
|
||||
ol.DEBUG && console.assert(ol.getUid(value) in this.items_,
|
||||
goog.DEBUG && console.assert(ol.getUid(value) in this.items_,
|
||||
'uid (%s) of value (%s) does not exist', ol.getUid(value), value);
|
||||
|
||||
var item = this.items_[ol.getUid(value)];
|
||||
|
||||
Reference in New Issue
Block a user