Rename _ol_AssertionError_ to AssertionError
This commit is contained in:
@@ -12,7 +12,7 @@ import {VERSION, inherits} from './index.js';
|
||||
* @implements {oli.AssertionError}
|
||||
* @param {number} code Error code.
|
||||
*/
|
||||
var _ol_AssertionError_ = function(code) {
|
||||
var AssertionError = function(code) {
|
||||
|
||||
var path = VERSION ? VERSION.split('-')[0] : 'latest';
|
||||
|
||||
@@ -36,6 +36,6 @@ var _ol_AssertionError_ = function(code) {
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_AssertionError_, Error);
|
||||
inherits(AssertionError, Error);
|
||||
|
||||
export default _ol_AssertionError_;
|
||||
export default AssertionError;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/Collection
|
||||
*/
|
||||
import {inherits} from './index.js';
|
||||
import _ol_AssertionError_ from './AssertionError.js';
|
||||
import AssertionError from './AssertionError.js';
|
||||
import _ol_CollectionEventType_ from './CollectionEventType.js';
|
||||
import _ol_Object_ from './Object.js';
|
||||
import Event from './events/Event.js';
|
||||
@@ -268,7 +268,7 @@ _ol_Collection_.prototype.updateLength_ = function() {
|
||||
_ol_Collection_.prototype.assertUnique_ = function(elem, opt_except) {
|
||||
for (var i = 0, ii = this.array_.length; i < ii; ++i) {
|
||||
if (this.array_[i] === elem && i !== opt_except) {
|
||||
throw new _ol_AssertionError_(58);
|
||||
throw new AssertionError(58);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/asserts
|
||||
*/
|
||||
import _ol_AssertionError_ from './AssertionError.js';
|
||||
import AssertionError from './AssertionError.js';
|
||||
var _ol_asserts_ = {};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ var _ol_asserts_ = {};
|
||||
*/
|
||||
_ol_asserts_.assert = function(assertion, errorCode) {
|
||||
if (!assertion) {
|
||||
throw new _ol_AssertionError_(errorCode);
|
||||
throw new AssertionError(errorCode);
|
||||
}
|
||||
};
|
||||
export default _ol_asserts_;
|
||||
|
||||
Reference in New Issue
Block a user