Fix parens grouping in typecasts

This commit is contained in:
Frederic Junod
2018-02-15 08:31:38 +01:00
parent 4744849b76
commit a8f4348add
16 changed files with 45 additions and 102 deletions

View File

@@ -145,7 +145,7 @@ Collection.prototype.item = function(index) {
* @api * @api
*/ */
Collection.prototype.getLength = function() { Collection.prototype.getLength = function() {
return (/** @type {number} */ this.get(Property.LENGTH)); return /** @type {number} */ (this.get(Property.LENGTH));
}; };

View File

@@ -197,9 +197,7 @@ Geolocation.prototype.positionError_ = function(error) {
* @api * @api
*/ */
Geolocation.prototype.getAccuracy = function() { Geolocation.prototype.getAccuracy = function() {
return ( return /** @type {number|undefined} */ (this.get(GeolocationProperty.ACCURACY));
/** @type {number|undefined} */ this.get(GeolocationProperty.ACCURACY)
);
}; };
@@ -210,9 +208,7 @@ Geolocation.prototype.getAccuracy = function() {
* @api * @api
*/ */
Geolocation.prototype.getAccuracyGeometry = function() { Geolocation.prototype.getAccuracyGeometry = function() {
return ( return /** @type {?ol.geom.Polygon} */ (this.get(GeolocationProperty.ACCURACY_GEOMETRY) || null);
/** @type {?ol.geom.Polygon} */ this.get(GeolocationProperty.ACCURACY_GEOMETRY) || null
);
}; };
@@ -224,9 +220,7 @@ Geolocation.prototype.getAccuracyGeometry = function() {
* @api * @api
*/ */
Geolocation.prototype.getAltitude = function() { Geolocation.prototype.getAltitude = function() {
return ( return /** @type {number|undefined} */ (this.get(GeolocationProperty.ALTITUDE));
/** @type {number|undefined} */ this.get(GeolocationProperty.ALTITUDE)
);
}; };
@@ -238,9 +232,7 @@ Geolocation.prototype.getAltitude = function() {
* @api * @api
*/ */
Geolocation.prototype.getAltitudeAccuracy = function() { Geolocation.prototype.getAltitudeAccuracy = function() {
return ( return /** @type {number|undefined} */ (this.get(GeolocationProperty.ALTITUDE_ACCURACY));
/** @type {number|undefined} */ this.get(GeolocationProperty.ALTITUDE_ACCURACY)
);
}; };
@@ -253,9 +245,7 @@ Geolocation.prototype.getAltitudeAccuracy = function() {
* @api * @api
*/ */
Geolocation.prototype.getHeading = function() { Geolocation.prototype.getHeading = function() {
return ( return /** @type {number|undefined} */ (this.get(GeolocationProperty.HEADING));
/** @type {number|undefined} */ this.get(GeolocationProperty.HEADING)
);
}; };
@@ -267,9 +257,7 @@ Geolocation.prototype.getHeading = function() {
* @api * @api
*/ */
Geolocation.prototype.getPosition = function() { Geolocation.prototype.getPosition = function() {
return ( return /** @type {ol.Coordinate|undefined} */ (this.get(GeolocationProperty.POSITION));
/** @type {ol.Coordinate|undefined} */ this.get(GeolocationProperty.POSITION)
);
}; };
@@ -281,9 +269,7 @@ Geolocation.prototype.getPosition = function() {
* @api * @api
*/ */
Geolocation.prototype.getProjection = function() { Geolocation.prototype.getProjection = function() {
return ( return /** @type {ol.proj.Projection|undefined} */ (this.get(GeolocationProperty.PROJECTION));
/** @type {ol.proj.Projection|undefined} */ this.get(GeolocationProperty.PROJECTION)
);
}; };
@@ -295,9 +281,7 @@ Geolocation.prototype.getProjection = function() {
* @api * @api
*/ */
Geolocation.prototype.getSpeed = function() { Geolocation.prototype.getSpeed = function() {
return ( return /** @type {number|undefined} */ (this.get(GeolocationProperty.SPEED));
/** @type {number|undefined} */ this.get(GeolocationProperty.SPEED)
);
}; };
@@ -308,9 +292,7 @@ Geolocation.prototype.getSpeed = function() {
* @api * @api
*/ */
Geolocation.prototype.getTracking = function() { Geolocation.prototype.getTracking = function() {
return ( return /** @type {boolean} */ (this.get(GeolocationProperty.TRACKING));
/** @type {boolean} */ this.get(GeolocationProperty.TRACKING)
);
}; };
@@ -324,9 +306,7 @@ Geolocation.prototype.getTracking = function() {
* @api * @api
*/ */
Geolocation.prototype.getTrackingOptions = function() { Geolocation.prototype.getTrackingOptions = function() {
return ( return /** @type {GeolocationPositionOptions|undefined} */ (this.get(GeolocationProperty.TRACKING_OPTIONS));
/** @type {GeolocationPositionOptions|undefined} */ this.get(GeolocationProperty.TRACKING_OPTIONS)
);
}; };

View File

@@ -171,7 +171,7 @@ inherits(Overlay, BaseObject);
* @api * @api
*/ */
Overlay.prototype.getElement = function() { Overlay.prototype.getElement = function() {
return (/** @type {Element|undefined} */ this.get(Property.ELEMENT)); return /** @type {Element|undefined} */ (this.get(Property.ELEMENT));
}; };
@@ -192,7 +192,7 @@ Overlay.prototype.getId = function() {
* @api * @api
*/ */
Overlay.prototype.getMap = function() { Overlay.prototype.getMap = function() {
return (/** @type {ol.PluggableMap|undefined} */ this.get(Property.MAP)); return /** @type {ol.PluggableMap|undefined} */ (this.get(Property.MAP));
}; };
@@ -203,7 +203,7 @@ Overlay.prototype.getMap = function() {
* @api * @api
*/ */
Overlay.prototype.getOffset = function() { Overlay.prototype.getOffset = function() {
return (/** @type {Array.<number>} */ this.get(Property.OFFSET)); return /** @type {Array.<number>} */ (this.get(Property.OFFSET));
}; };
@@ -215,7 +215,7 @@ Overlay.prototype.getOffset = function() {
* @api * @api
*/ */
Overlay.prototype.getPosition = function() { Overlay.prototype.getPosition = function() {
return (/** @type {ol.Coordinate|undefined} */ this.get(Property.POSITION)); return /** @type {ol.Coordinate|undefined} */ (this.get(Property.POSITION));
}; };
@@ -227,7 +227,7 @@ Overlay.prototype.getPosition = function() {
* @api * @api
*/ */
Overlay.prototype.getPositioning = function() { Overlay.prototype.getPositioning = function() {
return (/** @type {ol.OverlayPositioning} */ this.get(Property.POSITIONING)); return /** @type {ol.OverlayPositioning} */ (this.get(Property.POSITIONING));
}; };

View File

@@ -664,9 +664,7 @@ PluggableMap.prototype.getEventPixel = function(event) {
* @api * @api
*/ */
PluggableMap.prototype.getTarget = function() { PluggableMap.prototype.getTarget = function() {
return ( return /** @type {Element|string|undefined} */ (this.get(MapProperty.TARGET));
/** @type {Element|string|undefined} */ this.get(MapProperty.TARGET)
);
}; };
@@ -762,9 +760,7 @@ PluggableMap.prototype.getInteractions = function() {
* @api * @api
*/ */
PluggableMap.prototype.getLayerGroup = function() { PluggableMap.prototype.getLayerGroup = function() {
return ( return /** @type {ol.layer.Group} */ (this.get(MapProperty.LAYERGROUP));
/** @type {ol.layer.Group} */ this.get(MapProperty.LAYERGROUP)
);
}; };
@@ -813,9 +809,7 @@ PluggableMap.prototype.getRenderer = function() {
* @api * @api
*/ */
PluggableMap.prototype.getSize = function() { PluggableMap.prototype.getSize = function() {
return ( return /** @type {ol.Size|undefined} */ (this.get(MapProperty.SIZE));
/** @type {ol.Size|undefined} */ this.get(MapProperty.SIZE)
);
}; };
@@ -827,9 +821,7 @@ PluggableMap.prototype.getSize = function() {
* @api * @api
*/ */
PluggableMap.prototype.getView = function() { PluggableMap.prototype.getView = function() {
return ( return /** @type {ol.View} */ (this.get(MapProperty.VIEW));
/** @type {ol.View} */ this.get(MapProperty.VIEW)
);
}; };

View File

@@ -571,9 +571,7 @@ View.prototype.constrainRotation = function(rotation, opt_delta) {
* @api * @api
*/ */
View.prototype.getCenter = function() { View.prototype.getCenter = function() {
return ( return /** @type {ol.Coordinate|undefined} */ (this.get(ViewProperty.CENTER));
/** @type {ol.Coordinate|undefined} */ this.get(ViewProperty.CENTER)
);
}; };
@@ -700,9 +698,7 @@ View.prototype.getProjection = function() {
* @api * @api
*/ */
View.prototype.getResolution = function() { View.prototype.getResolution = function() {
return ( return /** @type {number|undefined} */ (this.get(ViewProperty.RESOLUTION));
/** @type {number|undefined} */ this.get(ViewProperty.RESOLUTION)
);
}; };
@@ -763,9 +759,7 @@ View.prototype.getResolutionForValueFunction = function(opt_power) {
* @api * @api
*/ */
View.prototype.getRotation = function() { View.prototype.getRotation = function() {
return ( return /** @type {number} */ (this.get(ViewProperty.ROTATION));
/** @type {number} */ this.get(ViewProperty.ROTATION)
);
}; };

View File

@@ -133,9 +133,7 @@ MousePosition.prototype.handleProjectionChanged_ = function() {
* @api * @api
*/ */
MousePosition.prototype.getCoordinateFormat = function() { MousePosition.prototype.getCoordinateFormat = function() {
return ( return /** @type {ol.CoordinateFormatType|undefined} */ (this.get(COORDINATE_FORMAT));
/** @type {ol.CoordinateFormatType|undefined} */ this.get(COORDINATE_FORMAT)
);
}; };
@@ -147,9 +145,7 @@ MousePosition.prototype.getCoordinateFormat = function() {
* @api * @api
*/ */
MousePosition.prototype.getProjection = function() { MousePosition.prototype.getProjection = function() {
return ( return /** @type {ol.proj.Projection|undefined} */ (this.get(PROJECTION));
/** @type {ol.proj.Projection|undefined} */ this.get(PROJECTION)
);
}; };

View File

@@ -119,9 +119,7 @@ inherits(ScaleLine, Control);
* @api * @api
*/ */
ScaleLine.prototype.getUnits = function() { ScaleLine.prototype.getUnits = function() {
return ( return /** @type {ol.control.ScaleLineUnits|undefined} */ (this.get(UNITS));
/** @type {ol.control.ScaleLineUnits|undefined} */ this.get(UNITS)
);
}; };

View File

@@ -199,12 +199,9 @@ GMLBase.prototype.readGeometryElement = function(node, objectStack) {
context['srsName'] = node.firstElementChild.getAttribute('srsName'); context['srsName'] = node.firstElementChild.getAttribute('srsName');
context['srsDimension'] = node.firstElementChild.getAttribute('srsDimension'); context['srsDimension'] = node.firstElementChild.getAttribute('srsDimension');
/** @type {ol.geom.Geometry} */ /** @type {ol.geom.Geometry} */
const geometry = pushParseAndPop(null, const geometry = pushParseAndPop(null, this.GEOMETRY_PARSERS_, node, objectStack, this);
this.GEOMETRY_PARSERS_, node, objectStack, this);
if (geometry) { if (geometry) {
return ( return /** @type {ol.geom.Geometry} */ (transformWithOptions(geometry, false, context));
/** @type {ol.geom.Geometry} */ transformWithOptions(geometry, false, context)
);
} else { } else {
return undefined; return undefined;
} }

View File

@@ -796,9 +796,7 @@ WKT.prototype.readGeometry;
WKT.prototype.readGeometryFromText = function(text, opt_options) { WKT.prototype.readGeometryFromText = function(text, opt_options) {
const geometry = this.parse_(text); const geometry = this.parse_(text);
if (geometry) { if (geometry) {
return ( return /** @type {ol.geom.Geometry} */ (transformWithOptions(geometry, false, opt_options));
/** @type {ol.geom.Geometry} */ transformWithOptions(geometry, false, opt_options)
);
} else { } else {
return null; return null;
} }

View File

@@ -67,7 +67,7 @@ inherits(Interaction, BaseObject);
* @api * @api
*/ */
Interaction.prototype.getActive = function() { Interaction.prototype.getActive = function() {
return (/** @type {boolean} */ this.get(InteractionProperty.ACTIVE)); return /** @type {boolean} */ (this.get(InteractionProperty.ACTIVE));
}; };

View File

@@ -114,9 +114,7 @@ BaseLayer.prototype.getLayerStatesArray = function(opt_states) {};
* @api * @api
*/ */
BaseLayer.prototype.getExtent = function() { BaseLayer.prototype.getExtent = function() {
return ( return /** @type {ol.Extent|undefined} */ (this.get(LayerProperty.EXTENT));
/** @type {ol.Extent|undefined} */ this.get(LayerProperty.EXTENT)
);
}; };
@@ -127,9 +125,7 @@ BaseLayer.prototype.getExtent = function() {
* @api * @api
*/ */
BaseLayer.prototype.getMaxResolution = function() { BaseLayer.prototype.getMaxResolution = function() {
return ( return /** @type {number} */ (this.get(LayerProperty.MAX_RESOLUTION));
/** @type {number} */ this.get(LayerProperty.MAX_RESOLUTION)
);
}; };
@@ -140,9 +136,7 @@ BaseLayer.prototype.getMaxResolution = function() {
* @api * @api
*/ */
BaseLayer.prototype.getMinResolution = function() { BaseLayer.prototype.getMinResolution = function() {
return ( return /** @type {number} */ (this.get(LayerProperty.MIN_RESOLUTION));
/** @type {number} */ this.get(LayerProperty.MIN_RESOLUTION)
);
}; };
@@ -153,9 +147,7 @@ BaseLayer.prototype.getMinResolution = function() {
* @api * @api
*/ */
BaseLayer.prototype.getOpacity = function() { BaseLayer.prototype.getOpacity = function() {
return ( return /** @type {number} */ (this.get(LayerProperty.OPACITY));
/** @type {number} */ this.get(LayerProperty.OPACITY)
);
}; };
@@ -173,9 +165,7 @@ BaseLayer.prototype.getSourceState = function() {};
* @api * @api
*/ */
BaseLayer.prototype.getVisible = function() { BaseLayer.prototype.getVisible = function() {
return ( return /** @type {boolean} */ (this.get(LayerProperty.VISIBLE));
/** @type {boolean} */ this.get(LayerProperty.VISIBLE)
);
}; };
@@ -187,9 +177,7 @@ BaseLayer.prototype.getVisible = function() {
* @api * @api
*/ */
BaseLayer.prototype.getZIndex = function() { BaseLayer.prototype.getZIndex = function() {
return ( return /** @type {number} */ (this.get(LayerProperty.Z_INDEX));
/** @type {number} */ this.get(LayerProperty.Z_INDEX)
);
}; };

View File

@@ -157,7 +157,7 @@ LayerGroup.prototype.handleLayersRemove_ = function(collectionEvent) {
* @api * @api
*/ */
LayerGroup.prototype.getLayers = function() { LayerGroup.prototype.getLayers = function() {
return (/** @type {!ol.Collection.<ol.layer.Base>} */ this.get(Property.LAYERS)); return /** @type {!ol.Collection.<ol.layer.Base>} */ (this.get(Property.LAYERS));
}; };

View File

@@ -190,7 +190,7 @@ Heatmap.prototype.createCircle_ = function() {
* @observable * @observable
*/ */
Heatmap.prototype.getBlur = function() { Heatmap.prototype.getBlur = function() {
return (/** @type {number} */ this.get(Property.BLUR)); return /** @type {number} */ (this.get(Property.BLUR));
}; };
@@ -201,7 +201,7 @@ Heatmap.prototype.getBlur = function() {
* @observable * @observable
*/ */
Heatmap.prototype.getGradient = function() { Heatmap.prototype.getGradient = function() {
return (/** @type {Array.<string>} */ this.get(Property.GRADIENT)); return /** @type {Array.<string>} */ (this.get(Property.GRADIENT));
}; };
@@ -212,7 +212,7 @@ Heatmap.prototype.getGradient = function() {
* @observable * @observable
*/ */
Heatmap.prototype.getRadius = function() { Heatmap.prototype.getRadius = function() {
return (/** @type {number} */ this.get(Property.RADIUS)); return /** @type {number} */ (this.get(Property.RADIUS));
}; };

View File

@@ -53,7 +53,7 @@ inherits(TileLayer, Layer);
* @api * @api
*/ */
TileLayer.prototype.getPreload = function() { TileLayer.prototype.getPreload = function() {
return (/** @type {number} */ this.get(TileProperty.PRELOAD)); return /** @type {number} */ (this.get(TileProperty.PRELOAD));
}; };
@@ -84,7 +84,7 @@ TileLayer.prototype.setPreload = function(preload) {
* @api * @api
*/ */
TileLayer.prototype.getUseInterimTilesOnError = function() { TileLayer.prototype.getUseInterimTilesOnError = function() {
return (/** @type {boolean} */ this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR)); return /** @type {boolean} */ (this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR));
}; };

View File

@@ -133,7 +133,7 @@ VectorLayer.prototype.getRenderBuffer = function() {
* order. * order.
*/ */
VectorLayer.prototype.getRenderOrder = function() { VectorLayer.prototype.getRenderOrder = function() {
return (/** @type {ol.RenderOrderFunction|null|undefined} */ this.get(Property.RENDER_ORDER)); return /** @type {ol.RenderOrderFunction|null|undefined} */ (this.get(Property.RENDER_ORDER));
}; };

View File

@@ -64,7 +64,7 @@ inherits(VectorTileLayer, VectorLayer);
* @api * @api
*/ */
VectorTileLayer.prototype.getPreload = function() { VectorTileLayer.prototype.getPreload = function() {
return (/** @type {number} */ this.get(TileProperty.PRELOAD)); return /** @type {number} */ (this.get(TileProperty.PRELOAD));
}; };
@@ -75,7 +75,7 @@ VectorTileLayer.prototype.getPreload = function() {
* @api * @api
*/ */
VectorTileLayer.prototype.getUseInterimTilesOnError = function() { VectorTileLayer.prototype.getUseInterimTilesOnError = function() {
return (/** @type {boolean} */ this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR)); return /** @type {boolean} */ (this.get(TileProperty.USE_INTERIM_TILES_ON_ERROR));
}; };