refactor: cleanup assert() & AssertionError definitions (#13859)

This commit is contained in:
Leo Kettmeir 2022-03-19 13:57:37 +01:00 committed by GitHub
parent ad8e238348
commit e55dee7fd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 30 additions and 60 deletions

View file

@ -4,7 +4,6 @@
((window) => {
const {
decodeURIComponent,
Error,
ObjectPrototypeIsPrototypeOf,
Promise,
SafeArrayIterator,
@ -34,19 +33,6 @@
}
}
class AssertionError extends Error {
constructor(msg) {
super(msg);
this.name = "AssertionError";
}
}
function assert(cond, msg = "Assertion failed.") {
if (!cond) {
throw new AssertionError(msg);
}
}
function createResolvable() {
let resolve;
let reject;
@ -154,8 +140,6 @@
log,
setLogDebug,
createResolvable,
assert,
AssertionError,
pathFromURL,
writable,
nonEnumerable,