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,7 +2,6 @@
|
||||
|
||||
goog.provide('ol.render.Box');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol.Disposable');
|
||||
goog.require('ol.geom.Polygon');
|
||||
|
||||
@@ -64,8 +63,8 @@ ol.render.Box.prototype.disposeInternal = function() {
|
||||
ol.render.Box.prototype.render_ = function() {
|
||||
var startPixel = this.startPixel_;
|
||||
var endPixel = this.endPixel_;
|
||||
goog.asserts.assert(startPixel, 'this.startPixel_ must be truthy');
|
||||
goog.asserts.assert(endPixel, 'this.endPixel_ must be truthy');
|
||||
ol.DEBUG && console.assert(startPixel, 'this.startPixel_ must be truthy');
|
||||
ol.DEBUG && console.assert(endPixel, 'this.endPixel_ must be truthy');
|
||||
var px = 'px';
|
||||
var style = this.element_.style;
|
||||
style.left = Math.min(startPixel[0], endPixel[0]) + px;
|
||||
@@ -107,11 +106,11 @@ ol.render.Box.prototype.setPixels = function(startPixel, endPixel) {
|
||||
* Creates or updates the cached geometry.
|
||||
*/
|
||||
ol.render.Box.prototype.createOrUpdateGeometry = function() {
|
||||
goog.asserts.assert(this.startPixel_,
|
||||
ol.DEBUG && console.assert(this.startPixel_,
|
||||
'this.startPixel_ must be truthy');
|
||||
goog.asserts.assert(this.endPixel_,
|
||||
ol.DEBUG && console.assert(this.endPixel_,
|
||||
'this.endPixel_ must be truthy');
|
||||
goog.asserts.assert(this.map_, 'this.map_ must be truthy');
|
||||
ol.DEBUG && console.assert(this.map_, 'this.map_ must be truthy');
|
||||
var startPixel = this.startPixel_;
|
||||
var endPixel = this.endPixel_;
|
||||
var pixels = [
|
||||
|
||||
Reference in New Issue
Block a user