From fe5da2e160c51c977fec1a0f315352781d9896d4 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Fri, 25 Jan 2019 16:28:01 +0100 Subject: [PATCH] Remove deprecated inherits function --- changelog/upgrade-notes.md | 5 +++++ doc/tutorials/background.md | 2 +- src/ol/index.js | 3 +-- src/ol/util.js | 28 ---------------------------- 4 files changed, 7 insertions(+), 31 deletions(-) diff --git a/changelog/upgrade-notes.md b/changelog/upgrade-notes.md index 2e03366499..009fe780ca 100644 --- a/changelog/upgrade-notes.md +++ b/changelog/upgrade-notes.md @@ -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. diff --git a/doc/tutorials/background.md b/doc/tutorials/background.md index dfe81e174f..6a3e4fb8e7 100644 --- a/doc/tutorials/background.md +++ b/doc/tutorials/background.md @@ -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'; ``` diff --git a/src/ol/index.js b/src/ol/index.js index e3e3d8607e..c36d77964e 100644 --- a/src/ol/index.js +++ b/src/ol/index.js @@ -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'; diff --git a/src/ol/util.js b/src/ol/util.js index 855c4ab808..048c10f218 100644 --- a/src/ol/util.js +++ b/src/ol/util.js @@ -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}