Use extends and super for format/WMSCapabilities

This commit is contained in:
ahocevar
2018-07-17 17:59:53 +02:00
parent df89b0718a
commit a4abd990df
2 changed files with 7 additions and 20 deletions
+2 -18
View File
@@ -1,7 +1,6 @@
/** /**
* @module ol/format/WMSCapabilities * @module ol/format/WMSCapabilities
*/ */
import {inherits} from '../util.js';
import {readHref} from '../format/XLink.js'; import {readHref} from '../format/XLink.js';
import XML from '../format/XML.js'; import XML from '../format/XML.js';
import {readDecimalString, readString, readNonNegativeInteger, readDecimal, readBooleanString, readNonNegativeIntegerString} from '../format/xsd.js'; import {readDecimalString, readString, readNonNegativeInteger, readDecimal, readBooleanString, readNonNegativeIntegerString} from '../format/xsd.js';
@@ -46,13 +45,11 @@ const CAPABILITY_PARSERS = makeStructureNS(
* @classdesc * @classdesc
* Format for reading WMS capabilities data * Format for reading WMS capabilities data
* *
* @extends {module:ol/format/XML}
* @api * @api
*/ */
class WMSCapabilities { class WMSCapabilities extends XML {
constructor() { constructor() {
super();
XML.call(this);
/** /**
* @type {string|undefined} * @type {string|undefined}
@@ -84,8 +81,6 @@ class WMSCapabilities {
} }
} }
inherits(WMSCapabilities, XML);
/** /**
* @const * @const
@@ -290,17 +285,6 @@ const KEYWORDLIST_PARSERS = makeStructureNS(
}); });
/**
* Read a WMS capabilities document.
*
* @function
* @param {Document|Node|string} source The XML source.
* @return {Object} An object representing the WMS capabilities.
* @api
*/
WMSCapabilities.prototype.read;
/** /**
* @param {Node} node Node. * @param {Node} node Node.
* @param {Array.<*>} objectStack Object stack. * @param {Array.<*>} objectStack Object stack.
+5 -2
View File
@@ -11,8 +11,11 @@ import {isDocument, isNode, parse} from '../xml.js';
*/ */
class XML { class XML {
/** /**
* @param {Document|Node|string} source Source. * Read the source document.
* @return {Object} The parsed result. *
* @param {Document|Node|string} source The XML source.
* @return {Object} An object representing the source.
* @api
*/ */
read(source) { read(source) {
if (isDocument(source)) { if (isDocument(source)) {