Shuffle assertions

This commit is contained in:
Tim Schaub
2016-08-09 00:05:25 -06:00
parent c40e1bc29b
commit d02cf1e7a9
39 changed files with 154 additions and 143 deletions

View File

@@ -282,7 +282,7 @@ ol.format.EsriJSON.writePointGeometry_ = function(geometry, opt_options) {
y: coordinates[1]
});
} else {
ol.assert(false, 34); // Invalid geometry layout
ol.asserts.assert(false, 34); // Invalid geometry layout
}
return /** @type {EsriJSONGeometry} */ (esriJSON);
};

View File

@@ -422,7 +422,7 @@ ol.format.GeoJSON.prototype.readFeaturesFromObject = function(
opt_options));
}
} else {
ol.assert(false, 35); // Unknown GeoJSON object type
ol.asserts.assert(false, 35); // Unknown GeoJSON object type
}
return /** Array.<ol.Feature> */ (features);
};
@@ -478,7 +478,7 @@ ol.format.GeoJSON.prototype.readProjectionFromObject = function(object) {
// is fixed and widely deployed.
projection = ol.proj.get('EPSG:' + crs.properties.code);
} else {
ol.assert(false, 36); // Unknown SRS type
ol.asserts.assert(false, 36); // Unknown SRS type
}
} else {
projection = this.defaultDataProjection;

View File

@@ -981,7 +981,7 @@ ol.format.KML.readMultiGeometry_ = function(node, objectStack) {
} else if (type == ol.geom.GeometryType.GEOMETRY_COLLECTION) {
multiGeometry = new ol.geom.GeometryCollection(geometries);
} else {
ol.assert(false, 37); // Unknown geometry type found
ol.asserts.assert(false, 37); // Unknown geometry type found
}
} else {
multiGeometry = new ol.geom.GeometryCollection(geometries);
@@ -1217,7 +1217,7 @@ ol.format.KML.PlacemarkStyleMapParser_ = function(node, objectStack) {
} else if (typeof styleMapValue === 'string') {
placemarkObject['styleUrl'] = styleMapValue;
} else {
ol.assert(false, 38); // `styleMapValue` has an unknown type
ol.asserts.assert(false, 38); // `styleMapValue` has an unknown type
}
};
@@ -2067,7 +2067,7 @@ ol.format.KML.writeCoordinatesTextNode_ = function(node, coordinates, objectStac
layout == ol.geom.GeometryLayout.XYZM) {
dimension = 3;
} else {
ol.assert(false, 34); // Invalid geometry layout
ol.asserts.assert(false, 34); // Invalid geometry layout
}
var d, i;
@@ -2259,7 +2259,7 @@ ol.format.KML.writeMultiGeometry_ = function(node, geometry, objectStack) {
(/** @type {ol.geom.MultiPolygon} */ (geometry)).getPolygons();
factory = ol.format.KML.POLYGON_NODE_FACTORY_;
} else {
ol.assert(false, 39); // Unknown geometry type
ol.asserts.assert(false, 39); // Unknown geometry type
}
ol.xml.pushSerializeAndPop(context,
ol.format.KML.MULTI_GEOMETRY_SERIALIZERS_, factory,

View File

@@ -355,7 +355,7 @@ ol.format.Polyline.prototype.writeFeatureText = function(feature, opt_options) {
if (geometry) {
return this.writeGeometryText(geometry, opt_options);
} else {
ol.assert(false, 40); // Expected `feature` to have a geometry
ol.asserts.assert(false, 40); // Expected `feature` to have a geometry
return '';
}
};

View File

@@ -386,7 +386,7 @@ ol.format.WFS.writeOgcFidFilter_ = function(node, fid, objectStack) {
*/
ol.format.WFS.writeDelete_ = function(node, feature, objectStack) {
var context = objectStack[objectStack.length - 1];
ol.assert(feature.getId() !== undefined, 26); // Features must have an id set
ol.asserts.assert(feature.getId() !== undefined, 26); // Features must have an id set
var featureType = context['featureType'];
var featurePrefix = context['featurePrefix'];
featurePrefix = featurePrefix ? featurePrefix :
@@ -410,7 +410,7 @@ ol.format.WFS.writeDelete_ = function(node, feature, objectStack) {
*/
ol.format.WFS.writeUpdate_ = function(node, feature, objectStack) {
var context = objectStack[objectStack.length - 1];
ol.assert(feature.getId() !== undefined, 27); // Features must have an id set
ol.asserts.assert(feature.getId() !== undefined, 27); // Features must have an id set
var featureType = context['featureType'];
var featurePrefix = context['featurePrefix'];
featurePrefix = featurePrefix ? featurePrefix :
@@ -802,7 +802,7 @@ ol.format.WFS.prototype.writeGetFeature = function(options) {
}
filter = options.filter;
if (options.bbox) {
ol.assert(options.geometryName,
ol.asserts.assert(options.geometryName,
12); // `options.geometryName` must also be provided when `options.bbox` is set
var bbox = ol.format.ogc.filter.bbox(
/** @type {string} */ (options.geometryName), options.bbox, options.srsName);
@@ -826,7 +826,7 @@ ol.format.WFS.prototype.writeGetFeature = function(options) {
'filter': filter,
'propertyNames': options.propertyNames ? options.propertyNames : []
};
ol.assert(Array.isArray(options.featureTypes),
ol.asserts.assert(Array.isArray(options.featureTypes),
11); // `options.featureTypes` should be an Array
ol.format.WFS.writeGetFeature_(node, /** @type {!Array.<string>} */ (options.featureTypes), [context]);
return node;