Use goog.asserts.fail

This commit is contained in:
Tom Payne
2013-04-08 19:10:04 +02:00
parent 098bddb72f
commit e132943eef
7 changed files with 7 additions and 7 deletions

View File

@@ -74,7 +74,7 @@ ol.array.linearFindNearest = function(arr, target, direction) {
}
// We should never get here, but the compiler complains
// if it finds a path for which no number is returned.
goog.asserts.assert(false);
goog.asserts.fail();
return n - 1;
}
};

View File

@@ -226,7 +226,7 @@ ol.control.ScaleLine.prototype.updateElement_ = function(frameState) {
pointResolution /= 1609.3472;
}
} else {
goog.asserts.assert(false);
goog.asserts.fail();
}
var i = 3 * Math.floor(

View File

@@ -77,7 +77,7 @@ ol.dom.transformElement2D = function(element, transform, opt_precision) {
ol.dom.setTransform(element, 'matrix(' + value2D + ')');
} else if (ol.dom.BrowserFeature.CAN_USE_MATRIX_FILTER) {
// http://msdn.microsoft.com/en-us/library/ms533014%28VS.85,loband%29.aspx
goog.asserts.assert(false); // FIXME
goog.asserts.fail(); // FIXME
} else {
// FIXME check this code!
var style = element.style;

View File

@@ -610,7 +610,7 @@ ol.projection.getTransformFromProjections =
ol.projection.identityTransform = function(input, opt_output, opt_dimension) {
if (goog.isDef(opt_output) && input !== opt_output) {
// TODO: consider making this a warning instead
goog.asserts.assert(false, 'This should not be used internally.');
goog.asserts.fail('This should not be used internally.');
for (var i = 0, ii = input.length; i < ii; ++i) {
opt_output[i] = input[i];
}

View File

@@ -73,7 +73,7 @@ ol.renderer.canvas.Map.prototype.createLayerRenderer = function(layer) {
} else if (layer instanceof ol.layer.Vector) {
return new ol.renderer.canvas.VectorLayer(this, layer);
} else {
goog.asserts.assert(false);
goog.asserts.fail();
return null;
}
};

View File

@@ -313,7 +313,7 @@ ol.renderer.webgl.Map.prototype.createLayerRenderer = function(layer) {
} else if (layer instanceof ol.layer.ImageLayer) {
layerRenderer = new ol.renderer.webgl.ImageLayer(this, layer);
} else {
goog.asserts.assert(false);
goog.asserts.fail();
}
return layerRenderer;
};

View File

@@ -235,7 +235,7 @@ ol.source.WMTS.optionsFromCapabilities = function(wmtsCap, layer) {
goog.asserts.assert(urls.length > 0);
break;
default:
goog.asserts.assert(false);
goog.asserts.fail();
}
return {