Shuffle assertions

This commit is contained in:
Tim Schaub
2016-08-09 00:05:25 -06:00
parent c40e1bc29b
commit d02cf1e7a9
39 changed files with 154 additions and 143 deletions

View File

@@ -130,7 +130,7 @@ ol.structs.LRUCache.prototype.forEach = function(f, opt_this) {
*/
ol.structs.LRUCache.prototype.get = function(key) {
var entry = this.entries_[key];
ol.assert(entry !== undefined,
ol.asserts.assert(entry !== undefined,
15); // Tried to get a value for a key that does not exist in the cache
if (entry === this.newest_) {
return entry.value_;
@@ -244,7 +244,7 @@ ol.structs.LRUCache.prototype.replace = function(key, value) {
ol.structs.LRUCache.prototype.set = function(key, value) {
goog.DEBUG && console.assert(!(key in {}),
'key is not a standard property of objects (e.g. "__proto__")');
ol.assert(!(key in this.entries_),
ol.asserts.assert(!(key in this.entries_),
16); // Tried to set a value for a key that is used already
var entry = /** @type {ol.LRUCacheEntry} */ ({
key_: key,

View File

@@ -125,7 +125,7 @@ ol.structs.PriorityQueue.prototype.dequeue = function() {
* @return {boolean} The element was added to the queue.
*/
ol.structs.PriorityQueue.prototype.enqueue = function(element) {
ol.assert(!(this.keyFunction_(element) in this.queuedElements_),
ol.asserts.assert(!(this.keyFunction_(element) in this.queuedElements_),
31); // Tried to enqueue an `element` that was already added to the queue
var priority = this.priorityFunction_(element);
if (priority != ol.structs.PriorityQueue.DROP) {