Shuffle assertions

This commit is contained in:
Tim Schaub
2016-08-09 00:05:25 -06:00
parent c40e1bc29b
commit d02cf1e7a9
39 changed files with 154 additions and 143 deletions

15
src/ol/asserts.js Normal file
View 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);
}
};