Remove goog.asserts.*
This pull requests replaces type check hint assertions with type casts, library sanity check assertions with conditional console.assert statements in debug mode, and runtime sanity checks with assertions that throw an ol.AssertionError with an error code for lookup outside the library.
This commit is contained in:
+2
-3
@@ -1,7 +1,6 @@
|
||||
goog.provide('ol.ImageBase');
|
||||
goog.provide('ol.ImageState');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol.events.EventTarget');
|
||||
goog.require('ol.events.EventType');
|
||||
goog.require('ol.Attribution');
|
||||
@@ -109,8 +108,8 @@ ol.ImageBase.prototype.getPixelRatio = function() {
|
||||
* @return {number} Resolution.
|
||||
*/
|
||||
ol.ImageBase.prototype.getResolution = function() {
|
||||
goog.asserts.assert(this.resolution !== undefined, 'resolution not yet set');
|
||||
return this.resolution;
|
||||
ol.DEBUG && console.assert(this.resolution !== undefined, 'resolution not yet set');
|
||||
return /** @type {number} */ (this.resolution);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user