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
|
||||
|
||||
Reference in New Issue
Block a user