Remove all remaining unnecessary casts

There is still such a cast in the goog library itself.
See https://github.com/google/closure-library/pull/637
This commit is contained in:
Guillaume Beraudo
2016-01-27 11:33:12 +01:00
parent 473cbba26e
commit 289e571fb0
11 changed files with 76 additions and 81 deletions
+7 -5
View File
@@ -486,8 +486,8 @@ ol.format.GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
return [];
}
if (node.localName == 'gpx') {
var features = ol.xml.pushParseAndPop(
/** @type {Array.<ol.Feature>} */ ([]), ol.format.GPX.GPX_PARSERS_,
/** @type {Array.<ol.Feature>} */
var features = ol.xml.pushParseAndPop([], ol.format.GPX.GPX_PARSERS_,
node, [this.getReadOptions(node, opt_options)]);
if (features) {
this.handleReadExtensions_(features);
@@ -600,7 +600,7 @@ ol.format.GPX.writeRte_ = function(node, feature, objectStack) {
var parentNode = objectStack[objectStack.length - 1].node;
var orderedKeys = ol.format.GPX.RTE_SEQUENCE_[parentNode.namespaceURI];
var values = ol.xml.makeSequence(properties, orderedKeys);
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */ (context),
ol.xml.pushSerializeAndPop(context,
ol.format.GPX.RTE_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
values, objectStack, orderedKeys);
};
@@ -615,6 +615,7 @@ ol.format.GPX.writeRte_ = function(node, feature, objectStack) {
ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
var options = /** @type {olx.format.WriteOptions} */ (objectStack[0]);
var properties = feature.getProperties();
/** @type {ol.xml.NodeStackItem} */
var context = {node: node, 'properties': properties};
var geometry = feature.getGeometry();
if (geometry) {
@@ -627,7 +628,7 @@ ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
var parentNode = objectStack[objectStack.length - 1].node;
var orderedKeys = ol.format.GPX.TRK_SEQUENCE_[parentNode.namespaceURI];
var values = ol.xml.makeSequence(properties, orderedKeys);
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */ (context),
ol.xml.pushSerializeAndPop(context,
ol.format.GPX.TRK_SERIALIZERS_, ol.xml.OBJECT_PROPERTY_NODE_FACTORY,
values, objectStack, orderedKeys);
};
@@ -640,9 +641,10 @@ ol.format.GPX.writeTrk_ = function(node, feature, objectStack) {
* @private
*/
ol.format.GPX.writeTrkSeg_ = function(node, lineString, objectStack) {
/** @type {ol.xml.NodeStackItem} */
var context = {node: node, 'geometryLayout': lineString.getLayout(),
'properties': {}};
ol.xml.pushSerializeAndPop(/** @type {ol.xml.NodeStackItem} */ (context),
ol.xml.pushSerializeAndPop(context,
ol.format.GPX.TRKSEG_SERIALIZERS_, ol.format.GPX.TRKSEG_NODE_FACTORY_,
lineString.getCoordinates(), objectStack);
};