Use super.method instead of prototype.method.call

This commit is contained in:
ahocevar
2018-08-06 15:22:22 +02:00
parent c5b42c49d5
commit 2f92e48e93
18 changed files with 25 additions and 25 deletions

View File

@@ -274,7 +274,7 @@ class GeometryCollection extends Geometry {
*/ */
disposeInternal() { disposeInternal() {
this.unlistenGeometriesChange_(); this.unlistenGeometriesChange_();
Geometry.prototype.disposeInternal.call(this); super.disposeInternal();
} }
} }

View File

@@ -411,7 +411,7 @@ class PointerEventHandler extends EventTarget {
*/ */
disposeInternal() { disposeInternal() {
this.unregister_(); this.unregister_();
EventTarget.prototype.disposeInternal.call(this); super.disposeInternal();
} }
} }

View File

@@ -108,7 +108,7 @@ class CanvasLineStringReplay extends CanvasReplay {
state.lastStroke = this.coordinates.length; state.lastStroke = this.coordinates.length;
} }
state.lastStroke = 0; state.lastStroke = 0;
CanvasReplay.prototype.applyStroke.call(this, state); super.applyStroke(state);
this.instructions.push(beginPathInstruction); this.instructions.push(beginPathInstruction);
} }
} }

View File

@@ -91,7 +91,7 @@ class WebGLImageReplay extends WebGLTextureReplay {
this.images_ = null; this.images_ = null;
this.hitDetectionImages_ = null; this.hitDetectionImages_ = null;
WebGLTextureReplay.prototype.finish.call(this, context); super.finish(context);
} }
/** /**

View File

@@ -338,7 +338,7 @@ class WebGLTextReplay extends WebGLTextureReplay {
this.images_ = null; this.images_ = null;
this.atlases_ = {}; this.atlases_ = {};
this.currAtlas_ = undefined; this.currAtlas_ = undefined;
WebGLTextureReplay.prototype.finish.call(this, context); super.finish(context);
} }
/** /**

View File

@@ -69,7 +69,7 @@ class CanvasImageLayerRenderer extends IntermediateCanvasRenderer {
if (this.vectorRenderer_) { if (this.vectorRenderer_) {
this.vectorRenderer_.dispose(); this.vectorRenderer_.dispose();
} }
IntermediateCanvasRenderer.prototype.disposeInternal.call(this); super.disposeInternal();
} }
/** /**
@@ -184,7 +184,7 @@ class CanvasImageLayerRenderer extends IntermediateCanvasRenderer {
if (this.vectorRenderer_) { if (this.vectorRenderer_) {
return this.vectorRenderer_.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback, thisArg); return this.vectorRenderer_.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback, thisArg);
} else { } else {
return IntermediateCanvasRenderer.prototype.forEachFeatureAtCoordinate.call(this, coordinate, frameState, hitTolerance, callback, thisArg); return super.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback, thisArg);
} }
} }
} }

View File

@@ -118,7 +118,7 @@ class IntermediateCanvasRenderer extends CanvasLayerRenderer {
if (this.getLayer().getSource().forEachFeatureAtCoordinate !== VOID) { if (this.getLayer().getSource().forEachFeatureAtCoordinate !== VOID) {
// for ImageCanvas sources use the original hit-detection logic, // for ImageCanvas sources use the original hit-detection logic,
// so that for example also transparent polygons are detected // so that for example also transparent polygons are detected
return CanvasLayerRenderer.prototype.forEachLayerAtCoordinate.apply(this, arguments); return super.forEachLayerAtCoordinate(arguments);
} else { } else {
const pixel = applyTransform(this.coordinateToCanvasPixelTransform, coordinate.slice()); const pixel = applyTransform(this.coordinateToCanvasPixelTransform, coordinate.slice());
scaleCoordinate(pixel, frameState.viewState.resolution / this.renderedResolution); scaleCoordinate(pixel, frameState.viewState.resolution / this.renderedResolution);

View File

@@ -209,7 +209,7 @@ class CanvasMapRenderer extends MapRenderer {
* @inheritDoc * @inheritDoc
*/ */
registerLayerRenderers(constructors) { registerLayerRenderers(constructors) {
MapRenderer.prototype.registerLayerRenderers.call(this, constructors); super.registerLayerRenderers(constructors);
for (let i = 0, ii = constructors.length; i < ii; ++i) { for (let i = 0, ii = constructors.length; i < ii; ++i) {
const ctor = constructors[i]; const ctor = constructors[i];
if (!includes(layerRendererConstructors, ctor)) { if (!includes(layerRendererConstructors, ctor)) {

View File

@@ -91,7 +91,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
*/ */
disposeInternal() { disposeInternal() {
unlisten(labelCache, EventType.CLEAR, this.handleFontsChanged_, this); unlisten(labelCache, EventType.CLEAR, this.handleFontsChanged_, this);
CanvasLayerRenderer.prototype.disposeInternal.call(this); super.disposeInternal();
} }
/** /**

View File

@@ -97,14 +97,14 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
*/ */
disposeInternal() { disposeInternal() {
unlisten(labelCache, EventType.CLEAR, this.handleFontsChanged_, this); unlisten(labelCache, EventType.CLEAR, this.handleFontsChanged_, this);
CanvasTileLayerRenderer.prototype.disposeInternal.call(this); super.disposeInternal();
} }
/** /**
* @inheritDoc * @inheritDoc
*/ */
getTile(z, x, y, pixelRatio, projection) { getTile(z, x, y, pixelRatio, projection) {
const tile = CanvasTileLayerRenderer.prototype.getTile.call(this, z, x, y, pixelRatio, projection); const tile = super.getTile(z, x, y, pixelRatio, projection);
if (tile.getState() === TileState.LOADED) { if (tile.getState() === TileState.LOADED) {
this.createReplayGroup_(tile, pixelRatio, projection); this.createReplayGroup_(tile, pixelRatio, projection);
if (this.context) { if (this.context) {
@@ -131,7 +131,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
} }
} }
this.renderedLayerRevision_ = layerRevision; this.renderedLayerRevision_ = layerRevision;
return CanvasTileLayerRenderer.prototype.prepareFrame.apply(this, arguments); return super.prepareFrame(frameState, layerState);
} }
/** /**
@@ -404,7 +404,7 @@ class CanvasVectorTileLayerRenderer extends CanvasTileLayerRenderer {
/** @type {number} */ (offsetX), /** @type {number} */ (offsetY)); /** @type {number} */ (offsetX), /** @type {number} */ (offsetY));
} }
} }
CanvasTileLayerRenderer.prototype.postCompose.apply(this, arguments); super.postCompose(context, frameState, layerState);
} }
/** /**

View File

@@ -291,7 +291,7 @@ class WebGLMapRenderer extends MapRenderer {
}); });
} }
this.context_.dispose(); this.context_.dispose();
MapRenderer.prototype.disposeInternal.call(this); super.disposeInternal();
} }
/** /**

View File

@@ -100,7 +100,7 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
disposeInternal() { disposeInternal() {
const context = this.mapRenderer.getContext(); const context = this.mapRenderer.getContext();
context.deleteBuffer(this.renderArrayBuffer_); context.deleteBuffer(this.renderArrayBuffer_);
WebGLLayerRenderer.prototype.disposeInternal.call(this); super.disposeInternal();
} }
/** /**
@@ -135,7 +135,7 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
* @inheritDoc * @inheritDoc
*/ */
handleWebGLContextLost() { handleWebGLContextLost() {
WebGLLayerRenderer.prototype.handleWebGLContextLost.call(this); super.handleWebGLContextLost();
this.locations_ = null; this.locations_ = null;
} }

View File

@@ -103,7 +103,7 @@ class WebGLVectorLayerRenderer extends WebGLLayerRenderer {
replayGroup.getDeleteResourcesFunction(context)(); replayGroup.getDeleteResourcesFunction(context)();
this.replayGroup_ = null; this.replayGroup_ = null;
} }
WebGLLayerRenderer.prototype.disposeInternal.call(this); super.disposeInternal();
} }
/** /**

View File

@@ -121,7 +121,7 @@ class ReprojImage extends ImageBase {
if (this.state == ImageState.LOADING) { if (this.state == ImageState.LOADING) {
this.unlistenSource_(); this.unlistenSource_();
} }
ImageBase.prototype.disposeInternal.call(this); super.disposeInternal();
} }
/** /**

View File

@@ -210,7 +210,7 @@ class ReprojTile extends Tile {
if (this.state == TileState.LOADING) { if (this.state == TileState.LOADING) {
this.unlistenSources_(); this.unlistenSources_();
} }
Tile.prototype.disposeInternal.call(this); super.disposeInternal();
} }
/** /**

View File

@@ -143,7 +143,7 @@ class Cluster extends VectorSource {
this.clear(); this.clear();
this.cluster(); this.cluster();
this.addFeatures(this.features); this.addFeatures(this.features);
VectorSource.prototype.refresh.call(this); super.refresh();
} }
/** /**

View File

@@ -132,7 +132,7 @@ class Static extends ImageSource {
this.image_.setImage(canvas); this.image_.setImage(canvas);
} }
} }
ImageSource.prototype.handleImageChange.call(this, evt); super.handleImageChange(evt);
} }
} }

View File

@@ -130,7 +130,7 @@ class TileImage extends UrlTile {
*/ */
canExpireCache() { canExpireCache() {
if (!ENABLE_RASTER_REPROJECTION) { if (!ENABLE_RASTER_REPROJECTION) {
return UrlTile.prototype.canExpireCache.call(this); return super.canExpireCache();
} }
if (this.tileCache.canExpireCache()) { if (this.tileCache.canExpireCache()) {
return true; return true;
@@ -149,7 +149,7 @@ class TileImage extends UrlTile {
*/ */
expireCache(projection, usedTiles) { expireCache(projection, usedTiles) {
if (!ENABLE_RASTER_REPROJECTION) { if (!ENABLE_RASTER_REPROJECTION) {
UrlTile.prototype.expireCache.call(this, projection, usedTiles); super.expireCache(projection, usedTiles);
return; return;
} }
const usedTileCache = this.getTileCacheForProjection(projection); const usedTileCache = this.getTileCacheForProjection(projection);
@@ -188,7 +188,7 @@ class TileImage extends UrlTile {
this.getProjection() && projection && !equivalent(this.getProjection(), projection)) { this.getProjection() && projection && !equivalent(this.getProjection(), projection)) {
return false; return false;
} else { } else {
return UrlTile.prototype.getOpaque.call(this, projection); return super.getOpaque(projection);
} }
} }