Remove deprecated inherits function

This commit is contained in:
Frederic Junod
2019-01-25 16:33:02 +01:00
parent 862553509a
commit fe5da2e160
4 changed files with 7 additions and 31 deletions
+5
View File
@@ -4,6 +4,11 @@
#### Backwards incompatible changes
##### Removal of the deprecated "inherits" function
The `inherits` function that was used to inherit the prototype methods from one constructor into another has been removed.
The standard ECMAScript classes should be used instead.
##### New internal tile coordinates
Previously, the internal tile coordinates used in the library had an unusual row order – the origin of the tile coordinate system was at the top left as expected, but the rows increased upwards. This meant that all tile coordinates within a tile grid's extent had negative `y` values.
+1 -1
View File
@@ -44,6 +44,6 @@ import {Tile, Vector} from 'ol/layer';
In addition to these re-exported classes, modules with lowercase names also provide constants or functions as named exports:
```js
import {inherits} from 'ol';
import {getUid} from 'ol';
import {fromLonLat} from 'ol/proj';
```
+1 -2
View File
@@ -30,5 +30,4 @@ export {default as VectorRenderTile} from './VectorRenderTile.js';
export {default as VectorTile} from './VectorTile.js';
export {default as View} from './View.js';
export {getUid, inherits, VERSION} from './util.js';
export {getUid, VERSION} from './util.js';
-28
View File
@@ -11,34 +11,6 @@ export function abstract() {
})());
}
/**
* Inherit the prototype methods from one constructor into another.
*
* Usage:
*
* function ParentClass(a, b) { }
* ParentClass.prototype.foo = function(a) { }
*
* function ChildClass(a, b, c) {
* // Call parent constructor
* ParentClass.call(this, a, b);
* }
* inherits(ChildClass, ParentClass);
*
* var child = new ChildClass('a', 'b', 'see');
* child.foo(); // This works.
*
* @param {!Function} childCtor Child constructor.
* @param {!Function} parentCtor Parent constructor.
* @function module:ol.inherits
* @deprecated
* @api
*/
export function inherits(childCtor, parentCtor) {
childCtor.prototype = Object.create(parentCtor.prototype);
childCtor.prototype.constructor = childCtor;
}
/**
* Counter for getUid.
* @type {number}