Rename goog.DEBUG to ol.DEBUG
This commit is contained in:
@@ -41,7 +41,7 @@ ol.structs.LRUCache = function() {
|
||||
};
|
||||
|
||||
|
||||
if (goog.DEBUG) {
|
||||
if (ol.DEBUG) {
|
||||
/**
|
||||
* FIXME empty description for jsdoc
|
||||
*/
|
||||
@@ -168,7 +168,7 @@ ol.structs.LRUCache.prototype.getKeys = function() {
|
||||
for (entry = this.newest_; entry; entry = entry.older) {
|
||||
keys[i++] = entry.key_;
|
||||
}
|
||||
goog.DEBUG && console.assert(i == this.count_, 'iterated correct number of times');
|
||||
ol.DEBUG && console.assert(i == this.count_, 'iterated correct number of times');
|
||||
return keys;
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ ol.structs.LRUCache.prototype.getValues = function() {
|
||||
for (entry = this.newest_; entry; entry = entry.older) {
|
||||
values[i++] = entry.value_;
|
||||
}
|
||||
goog.DEBUG && console.assert(i == this.count_, 'iterated correct number of times');
|
||||
ol.DEBUG && console.assert(i == this.count_, 'iterated correct number of times');
|
||||
return values;
|
||||
};
|
||||
|
||||
@@ -192,7 +192,7 @@ ol.structs.LRUCache.prototype.getValues = function() {
|
||||
* @return {T} Last value.
|
||||
*/
|
||||
ol.structs.LRUCache.prototype.peekLast = function() {
|
||||
goog.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
ol.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
return this.oldest_.value_;
|
||||
};
|
||||
|
||||
@@ -201,7 +201,7 @@ ol.structs.LRUCache.prototype.peekLast = function() {
|
||||
* @return {string} Last key.
|
||||
*/
|
||||
ol.structs.LRUCache.prototype.peekLastKey = function() {
|
||||
goog.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
ol.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
return this.oldest_.key_;
|
||||
};
|
||||
|
||||
@@ -210,10 +210,10 @@ ol.structs.LRUCache.prototype.peekLastKey = function() {
|
||||
* @return {T} value Value.
|
||||
*/
|
||||
ol.structs.LRUCache.prototype.pop = function() {
|
||||
goog.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
goog.DEBUG && console.assert(this.newest_, 'newest must not be null');
|
||||
ol.DEBUG && console.assert(this.oldest_, 'oldest must not be null');
|
||||
ol.DEBUG && console.assert(this.newest_, 'newest must not be null');
|
||||
var entry = this.oldest_;
|
||||
goog.DEBUG && console.assert(entry.key_ in this.entries_,
|
||||
ol.DEBUG && console.assert(entry.key_ in this.entries_,
|
||||
'oldest is indexed in entries');
|
||||
delete this.entries_[entry.key_];
|
||||
if (entry.newer) {
|
||||
@@ -243,7 +243,7 @@ ol.structs.LRUCache.prototype.replace = function(key, value) {
|
||||
* @param {T} value Value.
|
||||
*/
|
||||
ol.structs.LRUCache.prototype.set = function(key, value) {
|
||||
goog.DEBUG && console.assert(!(key in {}),
|
||||
ol.DEBUG && console.assert(!(key in {}),
|
||||
'key is not a standard property of objects (e.g. "__proto__")');
|
||||
ol.asserts.assert(!(key in this.entries_),
|
||||
16); // Tried to set a value for a key that is used already
|
||||
|
||||
@@ -61,7 +61,7 @@ ol.structs.PriorityQueue = function(priorityFunction, keyFunction) {
|
||||
ol.structs.PriorityQueue.DROP = Infinity;
|
||||
|
||||
|
||||
if (goog.DEBUG) {
|
||||
if (ol.DEBUG) {
|
||||
/**
|
||||
* FIXME empty description for jsdoc
|
||||
*/
|
||||
@@ -100,7 +100,7 @@ ol.structs.PriorityQueue.prototype.clear = function() {
|
||||
*/
|
||||
ol.structs.PriorityQueue.prototype.dequeue = function() {
|
||||
var elements = this.elements_;
|
||||
goog.DEBUG && console.assert(elements.length > 0,
|
||||
ol.DEBUG && console.assert(elements.length > 0,
|
||||
'must have elements in order to be able to dequeue');
|
||||
var priorities = this.priorities_;
|
||||
var element = elements[0];
|
||||
@@ -113,7 +113,7 @@ ol.structs.PriorityQueue.prototype.dequeue = function() {
|
||||
this.siftUp_(0);
|
||||
}
|
||||
var elementKey = this.keyFunction_(element);
|
||||
goog.DEBUG && console.assert(elementKey in this.queuedElements_,
|
||||
ol.DEBUG && console.assert(elementKey in this.queuedElements_,
|
||||
'key %s is not listed as queued', elementKey);
|
||||
delete this.queuedElements_[elementKey];
|
||||
return element;
|
||||
|
||||
@@ -30,7 +30,7 @@ ol.structs.RBush = function(opt_maxEntries) {
|
||||
*/
|
||||
this.items_ = {};
|
||||
|
||||
if (goog.DEBUG) {
|
||||
if (ol.DEBUG) {
|
||||
/**
|
||||
* @private
|
||||
* @type {number}
|
||||
@@ -46,7 +46,7 @@ ol.structs.RBush = function(opt_maxEntries) {
|
||||
* @param {T} value Value.
|
||||
*/
|
||||
ol.structs.RBush.prototype.insert = function(extent, value) {
|
||||
if (goog.DEBUG && this.readers_) {
|
||||
if (ol.DEBUG && this.readers_) {
|
||||
throw new Error('Can not insert value while reading');
|
||||
}
|
||||
/** @type {ol.RBushEntry} */
|
||||
@@ -60,7 +60,7 @@ ol.structs.RBush.prototype.insert = function(extent, value) {
|
||||
|
||||
this.rbush_.insert(item);
|
||||
// remember the object that was added to the internal rbush
|
||||
goog.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
|
||||
ol.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;
|
||||
};
|
||||
@@ -72,10 +72,10 @@ ol.structs.RBush.prototype.insert = function(extent, value) {
|
||||
* @param {Array.<T>} values Values.
|
||||
*/
|
||||
ol.structs.RBush.prototype.load = function(extents, values) {
|
||||
if (goog.DEBUG && this.readers_) {
|
||||
if (ol.DEBUG && this.readers_) {
|
||||
throw new Error('Can not insert values while reading');
|
||||
}
|
||||
goog.DEBUG && console.assert(extents.length === values.length,
|
||||
ol.DEBUG && console.assert(extents.length === values.length,
|
||||
'extens and values must have same length (%s === %s)',
|
||||
extents.length, values.length);
|
||||
|
||||
@@ -93,7 +93,7 @@ ol.structs.RBush.prototype.load = function(extents, values) {
|
||||
value: value
|
||||
};
|
||||
items[i] = item;
|
||||
goog.DEBUG && console.assert(!(ol.getUid(value) in this.items_),
|
||||
ol.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;
|
||||
}
|
||||
@@ -107,11 +107,11 @@ ol.structs.RBush.prototype.load = function(extents, values) {
|
||||
* @return {boolean} Removed.
|
||||
*/
|
||||
ol.structs.RBush.prototype.remove = function(value) {
|
||||
if (goog.DEBUG && this.readers_) {
|
||||
if (ol.DEBUG && this.readers_) {
|
||||
throw new Error('Can not remove value while reading');
|
||||
}
|
||||
var uid = ol.getUid(value);
|
||||
goog.DEBUG && console.assert(uid in this.items_,
|
||||
ol.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
|
||||
@@ -128,13 +128,13 @@ ol.structs.RBush.prototype.remove = function(value) {
|
||||
* @param {T} value Value.
|
||||
*/
|
||||
ol.structs.RBush.prototype.update = function(extent, value) {
|
||||
goog.DEBUG && console.assert(ol.getUid(value) in this.items_,
|
||||
ol.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)];
|
||||
var bbox = [item.minX, item.minY, item.maxX, item.maxY];
|
||||
if (!ol.extent.equals(bbox, extent)) {
|
||||
if (goog.DEBUG && this.readers_) {
|
||||
if (ol.DEBUG && this.readers_) {
|
||||
throw new Error('Can not update extent while reading');
|
||||
}
|
||||
this.remove(value);
|
||||
@@ -185,7 +185,7 @@ ol.structs.RBush.prototype.getInExtent = function(extent) {
|
||||
* @template S
|
||||
*/
|
||||
ol.structs.RBush.prototype.forEach = function(callback, opt_this) {
|
||||
if (goog.DEBUG) {
|
||||
if (ol.DEBUG) {
|
||||
++this.readers_;
|
||||
try {
|
||||
return this.forEach_(this.getAll(), callback, opt_this);
|
||||
@@ -207,7 +207,7 @@ ol.structs.RBush.prototype.forEach = function(callback, opt_this) {
|
||||
* @template S
|
||||
*/
|
||||
ol.structs.RBush.prototype.forEachInExtent = function(extent, callback, opt_this) {
|
||||
if (goog.DEBUG) {
|
||||
if (ol.DEBUG) {
|
||||
++this.readers_;
|
||||
try {
|
||||
return this.forEach_(this.getInExtent(extent), callback, opt_this);
|
||||
|
||||
Reference in New Issue
Block a user