all files / ol/ asserts.js

100% Statements 5/5
100% Branches 2/2
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15               4434× 31×      
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);
  }
};