Merge pull request #9157 from fredj/rm_inherits

Remove deprecated inherits function
This commit is contained in:
Frédéric Junod
2019-01-28 11:01:07 +01:00
committed by GitHub
4 changed files with 7 additions and 31 deletions

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.

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';
```

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';

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}