Use goog.DEBUG instead of ol.DEBUG for now

This commit is contained in:
Andreas Hocevar
2016-08-04 09:37:42 +02:00
parent 55ab5704d4
commit e0015b3d4e
121 changed files with 712 additions and 721 deletions

View File

@@ -88,7 +88,7 @@ ol.inherits(ol.geom.MultiPolygon, ol.geom.SimpleGeometry);
* @api stable
*/
ol.geom.MultiPolygon.prototype.appendPolygon = function(polygon) {
ol.DEBUG && console.assert(polygon.getLayout() == this.layout,
goog.DEBUG && console.assert(polygon.getLayout() == this.layout,
'layout of polygon should match layout');
/** @type {Array.<number>} */
var ends;
@@ -279,7 +279,7 @@ ol.geom.MultiPolygon.prototype.getSimplifiedGeometryInternal = function(squaredT
* @api stable
*/
ol.geom.MultiPolygon.prototype.getPolygon = function(index) {
ol.DEBUG && console.assert(0 <= index && index < this.endss_.length,
goog.DEBUG && console.assert(0 <= index && index < this.endss_.length,
'index should be in between 0 and the length of this.endss_');
if (index < 0 || this.endss_.length <= index) {
return null;
@@ -389,13 +389,13 @@ ol.geom.MultiPolygon.prototype.setCoordinates = function(coordinates, opt_layout
* @param {Array.<Array.<number>>} endss Endss.
*/
ol.geom.MultiPolygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, endss) {
ol.DEBUG && console.assert(endss, 'endss must be truthy');
goog.DEBUG && console.assert(endss, 'endss must be truthy');
if (!flatCoordinates || flatCoordinates.length === 0) {
ol.DEBUG && console.assert(endss.length === 0, 'the length of endss should be 0');
goog.DEBUG && console.assert(endss.length === 0, 'the length of endss should be 0');
} else {
ol.DEBUG && console.assert(endss.length > 0, 'endss cannot be an empty array');
goog.DEBUG && console.assert(endss.length > 0, 'endss cannot be an empty array');
var ends = endss[endss.length - 1];
ol.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1],
goog.DEBUG && console.assert(flatCoordinates.length == ends[ends.length - 1],
'the length of flatCoordinates should be the last value of ends');
}
this.setFlatCoordinatesInternal(layout, flatCoordinates);
@@ -418,7 +418,7 @@ ol.geom.MultiPolygon.prototype.setPolygons = function(polygons) {
layout = polygon.getLayout();
} else {
// FIXME better handle the case of non-matching layouts
ol.DEBUG && console.assert(polygon.getLayout() == layout,
goog.DEBUG && console.assert(polygon.getLayout() == layout,
'layout of polygon should be layout');
}
var offset = flatCoordinates.length;