Manual class transform

This commit is contained in:
Tim Schaub
2018-07-16 17:09:50 -06:00
parent 7b4a73f3b9
commit f78d0d4cfa
96 changed files with 8112 additions and 7964 deletions

View File

@@ -11,29 +11,32 @@ import {VERSION, inherits} from './util.js';
* @extends {Error}
* @param {number} code Error code.
*/
const AssertionError = function(code) {
class AssertionError {
const path = VERSION.split('-')[0];
constructor(code) {
const path = VERSION.split('-')[0];
/**
* @type {string}
*/
this.message = 'Assertion failed. See https://openlayers.org/en/' + path +
'/doc/errors/#' + code + ' for details.';
/**
* @type {string}
*/
this.message = 'Assertion failed. See https://openlayers.org/en/' + path +
'/doc/errors/#' + code + ' for details.';
/**
* Error code. The meaning of the code can be found on
* {@link https://openlayers.org/en/latest/doc/errors/} (replace `latest` with
* the version found in the OpenLayers script's header comment if a version
* other than the latest is used).
* @type {number}
* @api
*/
this.code = code;
/**
* Error code. The meaning of the code can be found on
* {@link https://openlayers.org/en/latest/doc/errors/} (replace `latest` with
* the version found in the OpenLayers script's header comment if a version
* other than the latest is used).
* @type {number}
* @api
*/
this.code = code;
this.name = 'AssertionError';
this.name = 'AssertionError';
};
}
}
inherits(AssertionError, Error);