Files
openlayers/src/ol/asserts.js
2016-09-03 14:57:32 +01:00

15 lines
299 B
JavaScript

goog.provide('ol.asserts');
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);
}
};