mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
refactor: cleanup assert() & AssertionError definitions (#13859)
This commit is contained in:
parent
ad8e238348
commit
e55dee7fd8
8 changed files with 30 additions and 60 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue