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.geom.Geometry');
|
||||
goog.provide('ol.geom.GeometryLayout');
|
||||
goog.provide('ol.geom.GeometryType');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol.functions');
|
||||
goog.require('ol.Object');
|
||||
goog.require('ol.extent');
|
||||
@@ -262,7 +261,7 @@ ol.geom.Geometry.prototype.translate = function(deltaX, deltaY) {};
|
||||
* @api stable
|
||||
*/
|
||||
ol.geom.Geometry.prototype.transform = function(source, destination) {
|
||||
goog.asserts.assert(
|
||||
ol.DEBUG && console.assert(
|
||||
ol.proj.get(source).getUnits() !== ol.proj.Units.TILE_PIXELS &&
|
||||
ol.proj.get(destination).getUnits() !== ol.proj.Units.TILE_PIXELS,
|
||||
'cannot transform geometries with TILE_PIXELS units');
|
||||
|
||||
Reference in New Issue
Block a user