Remove gratuitous debug assertions

This commit is contained in:
Andreas Hocevar
2016-08-04 11:01:40 +02:00
parent e0015b3d4e
commit e18d41b5e0
38 changed files with 12 additions and 102 deletions

View File

@@ -54,7 +54,6 @@ ol.interaction.DoubleClickZoom.handleEvent = function(mapBrowserEvent) {
var anchor = mapBrowserEvent.coordinate;
var delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;
var view = map.getView();
goog.DEBUG && console.assert(view, 'map must have a view');
ol.interaction.Interaction.zoomByDelta(
map, view, delta, anchor, this.duration_);
mapBrowserEvent.preventDefault();

View File

@@ -96,11 +96,9 @@ ol.interaction.DragAndDrop.handleStop_ = function(event) {
ol.interaction.DragAndDrop.prototype.handleResult_ = function(file, event) {
var result = event.target.result;
var map = this.getMap();
goog.DEBUG && console.assert(map, 'map must be set');
var projection = this.projection_;
if (!projection) {
var view = map.getView();
goog.DEBUG && console.assert(view, 'map must have view');
projection = view.getProjection();
goog.DEBUG && console.assert(projection !== undefined,
'projection should be defined');

View File

@@ -644,7 +644,6 @@ ol.interaction.Draw.prototype.removeLastPoint = function() {
*/
ol.interaction.Draw.prototype.finishDrawing = function() {
var sketchFeature = this.abortDrawing_();
goog.DEBUG && console.assert(sketchFeature, 'sketchFeature expected to be truthy');
var coordinates = this.sketchCoords_;
var geometry = /** @type {ol.geom.SimpleGeometry} */ (sketchFeature.getGeometry());
if (this.mode_ === ol.interaction.DrawMode.LINE_STRING) {
@@ -712,7 +711,6 @@ ol.interaction.Draw.prototype.extend = function(feature) {
var geometry = feature.getGeometry();
goog.DEBUG && console.assert(this.mode_ == ol.interaction.DrawMode.LINE_STRING,
'interaction mode must be "line"');
goog.DEBUG && console.assert(geometry, 'feature must have a geometry');
goog.DEBUG && console.assert(geometry.getType() == ol.geom.GeometryType.LINE_STRING,
'feature geometry must be a line string');
var lineString = /** @type {ol.geom.LineString} */ (geometry);

View File

@@ -87,7 +87,6 @@ ol.interaction.KeyboardPan.handleEvent = function(mapBrowserEvent) {
keyCode == ol.events.KeyCode.UP)) {
var map = mapBrowserEvent.map;
var view = map.getView();
goog.DEBUG && console.assert(view, 'map must have view');
var mapUnitsDelta = view.getResolution() * this.pixelDelta_;
var deltaX = 0, deltaY = 0;
if (keyCode == ol.events.KeyCode.DOWN) {

View File

@@ -74,7 +74,6 @@ ol.interaction.KeyboardZoom.handleEvent = function(mapBrowserEvent) {
var delta = (charCode == '+'.charCodeAt(0)) ? this.delta_ : -this.delta_;
map.render();
var view = map.getView();
goog.DEBUG && console.assert(view, 'map must have view');
ol.interaction.Interaction.zoomByDelta(
map, view, delta, undefined, this.duration_);
mapBrowserEvent.preventDefault();

View File

@@ -841,7 +841,6 @@ ol.interaction.Modify.prototype.insertVertex_ = function(segmentData, vertex) {
this.setGeometryCoordinates_(geometry, coordinates);
var rTree = this.rBush_;
goog.DEBUG && console.assert(segment !== undefined, 'segment should be defined');
rTree.remove(segmentData);
this.updateSegmentIndices_(geometry, index, depth, 1);
var newSegmentData = /** @type {ol.ModifySegmentDataType} */ ({

View File

@@ -131,7 +131,6 @@ ol.interaction.MouseWheelZoom.prototype.doZoom_ = function(map) {
var delta = ol.math.clamp(this.delta_, -maxDelta, maxDelta);
var view = map.getView();
goog.DEBUG && console.assert(view, 'map must have view');
map.render();
ol.interaction.Interaction.zoomByDelta(map, view, -delta, this.lastAnchor_,