Remove goog.asserts.*

This pull requests replaces type check hint assertions with type casts,
library sanity check assertions with conditional console.assert statements
in debug mode, and runtime sanity checks with assertions that throw an
ol.AssertionError with an error code for lookup outside the library.
This commit is contained in:
Andreas Hocevar
2016-07-19 16:39:58 +02:00
parent f50f1f401c
commit 6f5ed17fc5
158 changed files with 1488 additions and 1629 deletions

View File

@@ -111,6 +111,12 @@ describe('ol.math.solveLinearSystem', function() {
expect(result).to.be(null);
});
it('raises an exception when the matrix is malformed', function() {
var origAssert = console.assert;
console.assert = function(assertion, message) {
if (!assertion) {
throw new Error(message);
}
};
expect(function() {
ol.math.solveLinearSystem([
[2, 1, 3, 1],
@@ -126,6 +132,7 @@ describe('ol.math.solveLinearSystem', function() {
[6, 8, 18, 5, 0]
]);
}).to.throwException();
console.assert = origAssert;
});
});