Fix calling tools JS

This commit is contained in:
ayumi-signal 2024-05-23 15:19:12 -07:00 committed by GitHub
parent 5f0080a7d7
commit 29eb07c159
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 27 additions and 23 deletions

View file

@ -0,0 +1,19 @@
// Derived from Chromium WebRTC Internals Dashboard - see Acknowledgements for full license details
export function assert(value, message) {
if (value) {
return;
}
throw new Error("Assertion failed" + (message ? `: ${message}` : ""));
}
export function assertInstanceof(value, type, message) {
if (value instanceof type) {
return;
}
throw new Error(
message || `Value ${value} is not of type ${type.name || typeof type}`,
);
}
export function assertNotReached(message = "Unreachable code hit") {
assert(false, message);
}