Throw when calling abstract methods; fix abstract return types

This commit is contained in:
ahocevar
2018-10-30 18:45:42 +01:00
parent 2adac0b3e7
commit 1cdd040c96
22 changed files with 273 additions and 85 deletions

View File

@@ -1,6 +1,7 @@
/**
* @module ol/geom/SimpleGeometry
*/
import {abstract} from '../util.js';
import {createOrUpdateFromFlatCoordinates, getCenter} from '../extent.js';
import Geometry from '../geom/Geometry.js';
import GeometryLayout from '../geom/GeometryLayout.js';
@@ -52,7 +53,9 @@ class SimpleGeometry extends Geometry {
* @abstract
* @return {Array} Coordinates.
*/
getCoordinates() {}
getCoordinates() {
return abstract();
}
/**
* Return the first coordinate of the geometry.
@@ -158,7 +161,9 @@ class SimpleGeometry extends Geometry {
* @param {!Array} coordinates Coordinates.
* @param {GeometryLayout=} opt_layout Layout.
*/
setCoordinates(coordinates, opt_layout) {}
setCoordinates(coordinates, opt_layout) {
abstract();
}
/**
* @param {GeometryLayout|undefined} layout Layout.