Add assert messages for all assertions up until ol.renderer.vector.
This commit is contained in:
@@ -47,7 +47,7 @@ ol.format.XMLFeature.prototype.readFeature = function(source, opt_options) {
|
||||
var doc = ol.xml.parse(source);
|
||||
return this.readFeatureFromDocument(doc, opt_options);
|
||||
} else {
|
||||
goog.asserts.fail();
|
||||
goog.asserts.fail('Unknown source type');
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -90,7 +90,7 @@ ol.format.XMLFeature.prototype.readFeatures = function(source, opt_options) {
|
||||
var doc = ol.xml.parse(source);
|
||||
return this.readFeaturesFromDocument(doc, opt_options);
|
||||
} else {
|
||||
goog.asserts.fail();
|
||||
goog.asserts.fail('Unknown source type');
|
||||
return [];
|
||||
}
|
||||
};
|
||||
@@ -138,7 +138,7 @@ ol.format.XMLFeature.prototype.readGeometry = function(source, opt_options) {
|
||||
var doc = ol.xml.parse(source);
|
||||
return this.readGeometryFromDocument(doc, opt_options);
|
||||
} else {
|
||||
goog.asserts.fail();
|
||||
goog.asserts.fail('Unknown source type');
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -174,7 +174,7 @@ ol.format.XMLFeature.prototype.readProjection = function(source) {
|
||||
var doc = ol.xml.parse(source);
|
||||
return this.readProjectionFromDocument(doc);
|
||||
} else {
|
||||
goog.asserts.fail();
|
||||
goog.asserts.fail('Unknown source type');
|
||||
return null;
|
||||
}
|
||||
};
|
||||
@@ -205,7 +205,8 @@ ol.format.XMLFeature.prototype.readProjectionFromNode = function(node) {
|
||||
*/
|
||||
ol.format.XMLFeature.prototype.writeFeature = function(feature, opt_options) {
|
||||
var node = this.writeFeatureNode(feature, opt_options);
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
return goog.dom.xml.serialize(/** @type {Element} */(node));
|
||||
};
|
||||
|
||||
@@ -224,7 +225,8 @@ ol.format.XMLFeature.prototype.writeFeatureNode = goog.abstractMethod;
|
||||
*/
|
||||
ol.format.XMLFeature.prototype.writeFeatures = function(features, opt_options) {
|
||||
var node = this.writeFeaturesNode(features, opt_options);
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
return goog.dom.xml.serialize(/** @type {Element} */(node));
|
||||
};
|
||||
|
||||
@@ -242,7 +244,8 @@ ol.format.XMLFeature.prototype.writeFeaturesNode = goog.abstractMethod;
|
||||
*/
|
||||
ol.format.XMLFeature.prototype.writeGeometry = function(geometry, opt_options) {
|
||||
var node = this.writeGeometryNode(geometry, opt_options);
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT);
|
||||
goog.asserts.assert(node.nodeType == goog.dom.NodeType.ELEMENT,
|
||||
'node.nodeType should be ELEMENT');
|
||||
return goog.dom.xml.serialize(/** @type {Element} */(node));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user