Shuffle assertions
This commit is contained in:
15
src/ol/asserts.js
Normal file
15
src/ol/asserts.js
Normal file
@@ -0,0 +1,15 @@
|
||||
goog.provide('ol.asserts');
|
||||
|
||||
goog.require('ol');
|
||||
goog.require('ol.AssertionError');
|
||||
|
||||
|
||||
/**
|
||||
* @param {*} assertion Assertion we expected to be truthy.
|
||||
* @param {number} errorCode Error code.
|
||||
*/
|
||||
ol.asserts.assert = function(assertion, errorCode) {
|
||||
if (!assertion) {
|
||||
throw new ol.AssertionError(errorCode);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user